Re: Creating mixed target iOS and Mac project
Re: Creating mixed target iOS and Mac project
- Subject: Re: Creating mixed target iOS and Mac project
- From: Antonio Nunes <email@hidden>
- Date: Tue, 24 Aug 2010 11:20:48 +0100
On 24 Aug 2010, at 10:48, Antonio Nunes wrote:
> I suppose I need to add some preprocessor directives to main.m to setup the right environment:
>
> #ifdef BUILD_FOR_IOS
> int retval = UIApplicationMain....;
> #elifdef BUILD_FOR_MAC
> int retval = NSApplicationMain....;
> #endif
>
> Is this the right way to do it, or is there a better way? In addition, the build settings pane does not show the reprocessing section. How do I add the definitions to the build settings?
Actually, that code is not totally correct, and an older message on this list suggests a better definition to use. Better would be (showing all of main's contents):
#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
#else
return NSApplicationMain(argc, (const char **)argv);
#endif
But: it looks like the Architectures and Base SDK settings at the Project level trumps the same settings at the Target level. Shouldn't this be the other way around? (Using Xcode 3.2.3 here.) How do I get Xcode to use the correct Architecture and Base SDK, depending on the active target?
-António
-----------------------------------------------------------
And you would accept the seasons of your
heart, even as you have always accepted
the seasons that pass over your field.
--Kahlil Gibran
-----------------------------------------------------------
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden