开发者

iPhone, check for existence of constant

开发者 https://www.devze.com 2023-01-05 09:48 出处:网络
How can you check if a constant is set at runtime? For instance, in iOS 4, UIApplicationDidEnterBackgroundNotification is available, but when running on iOS 3 it开发者_JAVA技巧 will through an error i

How can you check if a constant is set at runtime? For instance, in iOS 4, UIApplicationDidEnterBackgroundNotification is available, but when running on iOS 3 it开发者_JAVA技巧 will through an error if you try to use it.


You should probably look at this other question, which in my opinion also answers yours. if (&UIApplicationWillEnterForegroundNotification != NULL) should be dynamic-linking-safe and tell you whether the constant exists or not.

0

精彩评论

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

关注公众号