ios5 Xcode 4.2滚动视图自我返回错误
我做了一个卡通应用程序。 在ios4.3中完美运行,但不应该运行ios5。
错误消息“由于未捕获的异常‘NSGenericException’而终止应用程序,原因:‘从 viewForZoomingInScrollView 返回的视图:必须是滚动视图的子视图。它不能是滚动视图本身。”
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
{
return self.scrollView;
}
如果无法滚动视图自行返回
将替换所有代码。
帮我。
I made a cartoon applications.
In ios4.3 perfectly well, but should not run ios5.
The error message "Terminating app due to uncaught exception 'NSGenericException', reason: 'The view returned from viewForZoomingInScrollView: must be a subview of the scroll view. It can not be the scroll view itself."
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
{
return self.scrollView;
}
If can't scroll view to self-return
Will replace all the code.
help me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这看起来确实是iOS5的一个新“功能”。 xD
不,我认为禁止返回然后调整滚动视图本身的大小是非常明智的。
给你的解决方案:
如果你的滚动视图只有一个子视图,比如 ImageView、GLKitView、MapView ...,则返回它。
如果您有更多元素,则将所有元素放置在容器(如 UIView)上,将其放置在滚动视图上并返回 UIView。
这确实应该是这样。我希望这对你也有用。
亲切的问候。 $h@rky
编辑:到目前为止有成功吗?
This really seems to be a new "feature" of iOS5. xD
No i think it's really sensible to forbid returning and then resizing the scrollview itself.
To your solution:
If u just have ONE subview of your scrollview like an ImageView, GLKitView, MapView ... return it.
In case u have more then place all elements on a container like an UIView, place this on the scrollview and return the UIView.
This really should be it. I hope this works for you, too.
Kind regards. $h@rky
Edit: Any success until now?