質問

I have the function:

- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale

The declaration is copied from the documentation. However, I am getting a "convicting parameter types

" warning 'CGFLoat' (aka double) vs 'float'.

Changing the float to a CGFloat does not make the warning go away. How do I fix?

役に立ちましたか?

解決

The (current) online documentation is actually wrong (or not up-to-date). It is documented in the iOS 7.0 API Diffs that the declaration of the delegate method has changed to

- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView
                  withView:(UIView *)view
                   atScale:(CGFloat)scale; // <-- "CGFloat" instead of "float"

On 64-bit architectures (such as arm64), CGFloat is defined as a double and therefore different from a float.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top