Question: In my project I have a simple `UIView` with a `UIScrollView` subview. I am trying to calculate the height based on the content within the `UIScrollView` with the following code:

![enter image description here](https://i.stack.imgur.com/HkZYE.png)

file.h

```
@interface ScrollViewController : UIViewController {
IBOutlet UILabel* topLabel;
IBOutlet UILabel* bottomLabel;
    IBOutlet UIScrollView * scroller;   
} 

@property(nonatomic,retain) IBOutlet UIScrollView *scroller;

```

file.m

```
- (void)viewDidLoad {
    [scroller setScrollEnabled:YES];
    CGFloat scrollViewHeight = 0.0f;
    for (UIView* view in scroller.subviews)
    {
       scrollViewHeight += view.frame.size.height;
    }
    // print value 88.000000
    NSLog(@"%f", scrollViewHeight);
    [scroller setContentSize:CGSizeMake(320, scrollViewHeight)];
    [super viewDidLoad];
}

```

I don't know why the code doesn't work.

Answer: 
Also mind that clocks between client - broker need to be in sync, for the expiry to work properly. If the clocks is not in sync, then the expiry set from the client, may already be expired when the message is received on the broker. Or the client time is ahead of the broker, so the expiry is longer than the 10 secs.

It kinda beats me why the expiry is client time based. So AMQ offers a plugin, to fix this by realigning the time, to be broker based only. See <https://activemq.apache.org/timestampplugin.html>
Endpoint option **timeToLive** (<http://camel.apache.org/jms.html>) worked for me as a solution for the described problem, messages are removed from a queue after 300000 miliseconds.
e.g. "activemq:Q.QUEUE?disableReplyTo=true&**timeToLive**=300000"

Setting header JMSExpiration, didn't cause removing message from a queue automatically in my case. 
But this doc <https://www.ibm.com/support/knowledgecenter/en/SSAW57_9.0.0/com.ibm.websphere.nd.multiplatform.doc/ae/rwsf_prjms_timetolive.html> gave me a hint.