• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Creating mixed target iOS and Mac project
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Creating mixed target iOS and Mac project
      • From: Ralf Schuchardt <email@hidden>
References: 
 >Creating mixed target iOS and Mac project (From: Antonio Nunes <email@hidden>)

  • Prev by Date: Re: [IB] Cells vs Controls in the Library
  • Next by Date: Re: [IB] Cells vs Controls in the Library
  • Previous by thread: Creating mixed target iOS and Mac project
  • Next by thread: Re: Creating mixed target iOS and Mac project
  • Index(es):
    • Date
    • Thread