tags:

views:

52

answers:

1

I am building a sort of slide show where the user slides through the images himself via a scrollView with paging enabled. i have a view controller for portrait and a view controller for landscape. The portrait view controller works fine with the "scrollViewDidEndDecelerating" function but i did the same exact thing on the landscape view controller and it does not respond.

- (void)viewDidLoad {
[super viewDidLoad];

imageNamesArray = [[NSMutableArray alloc] initWithCapacity:LNumImages];
int x = 0;
for(x=0; x<LNumImages;x++) {
    [imageNamesArray insertObject: [NSString stringWithFormat:@"kr_Page_%d.png",x+1] atIndex:x];
}

LScrollView.delegate = self;
LScrollView.pagingEnabled = YES;
LScrollView.showsHorizontalScrollIndicator = YES;
LScrollView.contentSize = CGSizeMake(LScrollWidth * LNumImages, LScrollHeight);
[self initImages:0]; 
}

- (void)LScrollViewDidEndDecelerating:(UIScrollView *)LScrollView {
    NSLog(@"stopped");
    //does not get called
    //[self arangeImages];
}
A: 

Because you're not implementing a UIScrollViewDelegate method. Note you're implementing LScrollViewDidEndDecelerating: and not scrollViewDidEndDecelerating:

See the UIScrollViewDelegate documentation for more information.

jer