Why does my -scrollViewWillBeginDragging method of my UIScrollView delegate return such a strange contentOffset value?

PROBLEM SOLVES! STUPID TYPO IN MY CODE!

That's my method of my UIScrollView delegate:

- (void)scrollViewWillBeginDragging:(UIScrollView *)activeScrollView {
    NSLog(@"contentOffset: %f", activeScrollView.contentOffset);
}

      

The console output looks like this:

2009-05-06 23:04:45.731 Demo[4851:20b] contentOffset: 21080643979530096233938944.000000

      

for sure my content Offset is not that huge;)

+1


a source to share


3 answers


contentOffset returns a CGPoint structure, so you want to use activeScrollView.contentOffset.y

instead of trying to pass the entire structure into% f, which is the format specifier for doubles.



+2


a source


Since contentOffset is CGPoint.



+2


a source


use NSLog (@ "ContenfOffset:% @", NSStringFromCGPoint (activeScrollView.contentOffset));

0


a source







All Articles