• 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: The best way to call Cocoa methods not implemented in previous versions of the SDK?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The best way to call Cocoa methods not implemented in previous versions of the SDK?


  • Subject: Re: The best way to call Cocoa methods not implemented in previous versions of the SDK?
  • From: Chris Hanson <email@hidden>
  • Date: Tue, 06 Sep 2011 16:31:35 -0700

On Sep 6, 2011, at 3:33 AM, Oleg Krupnov wrote:

> I'm implementing a new Lion's API, namely the resume. I need to make
> the following call:
>
> [window setRestorationClass:someClass];
>
> I'd like my app to also work on Snow Leopard, so I do this:
>
> if ([window respondsToSelector:@selector(setRestorationClass:)])
> {
> [window setRestorationClass:someClass];
> }

It may be better to actually check whether your code is running on Snow Leopard rather than make -respondsToSelector: checks.

> however, because I compile for Snow Leopard, the compiler will still
> give me a warning that the setRestorationClass: method is not defined.

What do you mean "compile for Snow Leopard"?  You should set your Base SDK to the most recent OS whose features you are going to use (in this case 10.7) and set your Deployment Target to the least recent OS you want to run on (in this case 10.6).

Furthermore, Xcode 3.2.6 and 4.0 added "Latest Mac OS X" and "Latest iOS" options to the Base SDK pop-up, which is preferable to specifying a particular OS version for the SDK against which you wish to build.

  -- Chris

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: The best way to call Cocoa methods not implemented in previous versions of the SDK?
      • From: Wim Lewis <email@hidden>
    • Re: The best way to call Cocoa methods not implemented in previous versions of the SDK?
      • From: Shane Stanley <email@hidden>
    • Re: The best way to call Cocoa methods not implemented in previous versions of the SDK?
      • From: Ken Thomases <email@hidden>
References: 
 >The best way to call Cocoa methods not implemented in previous versions of the SDK? (From: Oleg Krupnov <email@hidden>)

  • Prev by Date: Re: using AppKit additions in background threads
  • Next by Date: Error opening xib file: "-[IBUIScreenMetrics initWithCoder:]: unrecognized selector"
  • Previous by thread: Re: The best way to call Cocoa methods not implemented in previous versions of the SDK?
  • Next by thread: Re: The best way to call Cocoa methods not implemented in previous versions of the SDK?
  • Index(es):
    • Date
    • Thread