I have a scroll view in my app, initialized through storyboard, and I am attempting to change the frame. Everything seems to work, but if the frame and content size are accessed just a short time after they are set, but after my method returns, they are different! Here is the code:
CGFloat inputHeight = inputView.frame.size.height;
originalContentHeight = self.scrollableContentView.frame.size.height;
NSLog(@"%f", self.scrollableContentView.frame.size.height-inputHeight);
[self.scrollableContentView setFrame:CGRectMake(self.scrollableContentView.frame.origin.x, self.scrollableContentView.frame.origin.y, self.scrollableContentView.frame.size.width, self.scrollableContentView.frame.size.height-inputHeight)];
NSLog(@"%f", self.scrollableContentView.frame.size.height);
NSLog(@"%@", self.scrollableContentView);
The output of these logs are all as expected, that is:
<UIScrollView: 0x808de00; frame = (0 0; 320 81); ... >
However, if I set a breakpoint in another method, by the time that is called, logging the scrollView shows this:
<UIScrollView: 0x808de00; frame = (0 0; 320 416); ... >
Additionally, the content size changes as such:
(width=320, height=416)
to
(width=320, height=504)
Both of the values seem to be reverting automatically to the values they have when the view is first laid out. I have set breakpoints in the getter and setter of my scroll view, and cannot find any unexpected accesses, so I have concluded that the change must come internally. Is this a justifiable conclusion? What could be going wrong?