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: 
Well the 
 setJMSExpiration(long expiration): 

is something you MUST not call when you are the client. See my talk on this a bit on the ActiveMQ forum.

<https://apache-qpid-developers.2158895.n2.nabble.com/MRG-Java-JMS-Expiration-td7171854.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.