What are the best macros to use to know when compiling is for Mac OS X v.s. iOS?
-
hi-
What are the best macros to use to know when compiling is for Mac OS X v.s. iOS?
thanks!-
-lance -
Hello,
In short, it's probably best to use the TARGET_OS_IPHONE macro.
I used to use TARGET_OS_MAC when writing mac-specific code, but found that
even on iOS this was turned on making it a bit unreliable (or making you
redefine things in your own code)...
So it's probably a better idea to just stick to using the
TARGET_OS_IPHONE macro
as you can check it against both environments.
See this post:
http://stackoverflow.com/questions/3181321/which-conditional-compile-to-use
-to-switch-between-mac-and-iphone-specific-code
Of course, if anyone on the list has a better solution, I'm all ears as
well.
Thanks,
Kappa
On Fri, Dec 30, 2011 at 11:44 AM, lbland <lbland...> wrote:
> hi-
>
> What are the best macros to use to know when compiling is for Mac OS X
> v.s. iOS?
>
> thanks!-
>
> -lance
>
-
http://developer.apple.com/library/mac/#documentation/developertools/concep
tual/cross_development/Using/using.html
See the section on "conditionally compiling for different SDKs."
(Sent from my iPad.)
--
Conrad Shultz
On Dec 30, 2011, at 8:44, lbland <lbland...> wrote:
> hi-
>
> What are the best macros to use to know when compiling is for Mac OS X v.s. iOS?
>
> thanks!-
>
> -lance
-
hi-
On Dec 30, 2011, at 1:16 PM, Conrad Shultz wrote:
So...
__MAC_OS_X_VERSION_MAX_ALLOWED
is better than:
TARGET_OS_IPHONE
??
... ack! ack!
thanks!-
-lance -
On Dec 30, 2011, at 10:34 AM, lbland wrote:
> On Dec 30, 2011, at 1:16 PM, Conrad Shultz wrote:
>
>> http://developer.apple.com/library/mac/#documentation/developertools/concep
tual/cross_development/Using/using.html
>
> So...
>
> __MAC_OS_X_VERSION_MAX_ALLOWED
>
> is better than:
>
> TARGET_OS_IPHONE
Both will work. Personally, I prefer the TargetConditionals version because it also provides macros for iOS simulator and device.
http://www.sealiesoftware.com/blog/archive/2010/8/16/TargetConditionalsh.ht
ml
--
Greg Parker <gparker...> Runtime Wrangler


