how can i get the x position of the contentOffset?
here´s my code but that throws always 0 in the log
- (void)adjustAreaScroll:(NSNotification *)notification
{
int value = [[notification object] intValue];
NSLog(@"adjustAreaScroll, %i", value);
switch (value) {
case 0:
[topScroll setContentOffset:CGPointMake(0, 0)];
break;
case 1:
[topScroll setContentOffset:CGPointMake(1024, 0)];
break;
case 2:
[topScroll setContentOffset:CGPointMake(2048, 0)];
break;
case 3:
[topScroll setContentOffset:CGPointMake(3072, 0)];
break;
}
NSLog(@"target position -----> %i", self.topScroll.contentOffset.x);
}
CGPointMake returns a CGPoint, which is made of CGFloats. Make the %i into %f.