I am working on a menu of an application. The problem now is that i can't get the UIScrollView working. The UIScrollView is in a Xib file. It loads normal but when I try to scroll it crashed.
I think the problem is that I use a UIViewController since when I remove the delegate not to itself it is working. Now I got: scrollView.delegate = self;
When the delegate is the appDelegate it is working but that is not what I want.
The following functions I used in my class:
- (void)loadScrollViewWithPage:(int)page
- (void)scrollViewDidScroll:(UIScrollView *)sender
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
I think I got 2 options. Create a NSObject with a view (is this possible) or a object that is the delegate of the UIScrollview.
The error what i gaves is:
2009-11-14 17:50:25.723 Par23[1240:20b] * -[NSCFType scrollViewDidScroll:]: unrecognized selector sent to instance 0x4834190
2009-11-14 17:50:25.724 Par23[1240:20b] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFType scrollViewDidScroll:]: unrecognized selector sent to instance 0x4834190'
It is not a problem of the function. When I remove all the code in the functions it still gave this error
The scrollview got the following settings:
scrollView.pagingEnabled = YES;
scrollView.contentSize = CGSizeMake(scrollView.frame.size.width * kNumberOfPages, scrollView.frame.size.height);
scrollView.showsHorizontalScrollIndicator = NO;
scrollView.showsVerticalScrollIndicator = NO;
scrollView.scrollsToTop = NO;
scrollView.delegate = self;