Check for availability of blocks at runtime on iOS

我与影子孤独终老i 提交于 2019-12-30 04:44:03

问题


I need to test for the availability of blocks at runtime, so I can handle backwards compatibility with iOS 3. Any tips?

edit: So far I'm doing if (!NSClassFromString(@"NSBlockOperation")) {...} Seems to be working...


回答1:


You will also need to make sure to weak link the libSystem.B.dylib, set your base SDK to 4.0 and deployment target to 3.1.3, as described here.

A good overview on how to deal with iOS versioning issues can also be found in this this Cocoa with Love article: Tips & Tricks for conditional iOS3, iOS3.2 and iOS4 code



来源:https://stackoverflow.com/questions/4231965/check-for-availability-of-blocks-at-runtime-on-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!