I’ve created a UIScrollView within interface builder, and I have linked this all up correctly. When I try to set userInteractionEnabled on the scrollV it doesn’t seem to change the value (see below):

I’ve printed out numerous values to check what is happening and I am getting confused:
(lldb) p self.scrollV.userInteractionEnabled
(BOOL) $3 = NO
(lldb) p self.scrollV.contentSize
(CGSize) $4 = (width=320, height=479)
(lldb) p self.scrollV.frame
error: property ‘frame’ not found on object of type ‘UIScrollView *’ error: 1 errors parsing expression
I found it weird that the frame property was not showing, however when I print out the scrollView by itself I get the following:
(lldb) po self.scrollV
(UIScrollView *) $5 = 0x16f7a8d0 <UIScrollView: 0x16f7a8d0; frame = (0 60; 320 312); clipsToBounds = YES; autoresize = RM+TM; gestureRecognizers = <NSArray: 0x16fb2630>; layer = <CALayer: 0x16f08860>; contentOffset: {0, 0}>
This seems to imply to me that there are 2 UIScrollViews working independently of one another, I originally had the scrollV declared as follows an instance variable using IBOutlet UIScrollView *scrollV;
However, to see if this was causing an issue for some reason I have also tried using:
@property (nonatomic, retain) IBOutlet UIScrollView *scrollV; and changing all the references to ‘self.’.
Can anyone offer any advice as to why this would be happening? I am currently adding objects to the scrollV using the following function:
- (void)addTitle:(NSString *)title withText:(NSString *)text andPosition:(int *)yPos
{
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(4, *yPos, 312, 30)];
[titleLabel setTextColor:kBlueColor];
[titleLabel setText:[NSString stringWithFormat:@" %@", title]];
[titleLabel setFont:[UIFont boldSystemFontOfSize:18]];
*yPos += titleLabel.frame.size.height;
// Rounds up the int
int tbHeight = (([text length] + 40 - 1) / 40);
tbHeight = 19 + (19 * tbHeight);
UITextView *textV = [[UITextView alloc] initWithFrame:CGRectMake(4, *yPos, 312, tbHeight)];
[textV setTextColor:kBlueColor];
[textV setFont:[UIFont systemFontOfSize:14]];
[textV setScrollEnabled:NO];
[textV setShowsVerticalScrollIndicator:NO];
[textV setEditable:NO];
[textV setText:text];
*yPos += textV.frame.size.height + 5;
[self.scrollV addSubview:titleLabel];
[self.scrollV addSubview:textV];
}
I have added the code just incase any of this is interfering with the scrollV for some reason. When running the app all the views are shown, so the scrollV definitely exists and is linked up in IB fine.
Any advice on this matter would be very welcome.
Thanks!
Okay I managed to solve this, it appears I accidentally set the UIView userInteractionEnabled to NO within interface builder. This will apply this to all subviews, thus causing my scrollView to be NO as well.