Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone, check for existence of constant

Tags:

iphone

extern

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 will through an error if you try to use it.

like image 366
David Beck Avatar asked Jul 03 '10 16:07

David Beck


1 Answers

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.

like image 118
Romain Avatar answered Nov 18 '22 11:11

Romain