开发者

Illegal iphone api function usage

开发者 https://www.devze.com 2023-03-06 18:27 出处:网络
Can I use objc_getClassList and class_getSuperclass in my iPhone application? Why \"objc/objc-runtime.h\" is not prese开发者_C百科nt when compiling for the device?

Can I use objc_getClassList and class_getSuperclass in my iPhone application? Why "objc/objc-runtime.h" is not prese开发者_C百科nt when compiling for the device? PS: Actually I am using 4.2 SDK


For objc_getClassList not working on the device, I believe the problem is that the class definitions are in a static library, so you must add the -ObjC flag to the linker. The result of doing this is that the "entire" static library that defines a particular class will be loaded. See this link from Apple

According to Apple's runtime reference, you should use "superclass" instead of class_getSuperclass

0

精彩评论

暂无评论...
验证码 换一张
取 消