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: Ralf Schuchardt <email@hidden>
- Date: Tue, 24 Aug 2010 13:39:03 +0200
Am 24.08.2010 um 12:20 schrieb Antonio Nunes:
> 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?
That seems to be a bug in this Xcode version. You can select the right active SDK by Option-clicking on the "Overview" popup before building.
Ralf
_______________________________________________
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