• 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
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]

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


  • Subject: The best way to call Cocoa methods not implemented in previous versions of the SDK?
  • From: Oleg Krupnov <email@hidden>
  • Date: Tue, 06 Sep 2011 13:33:13 +0300

Hi,

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];
}

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

How do I work around this, other than using [NSObject
performSelector:withObject:...], which looks too cumbersome, and other
than deriving all windows from a base class that will define this
method? Extensions are not suitable either, because there is no way to
call super from them. Any other ideas?

Thanks.
_______________________________________________

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: Chris Hanson <email@hidden>
    • Re: The best way to call Cocoa methods not implemented in previous versions of the SDK?
      • From: Quincey Morris <email@hidden>
    • Re: The best way to call Cocoa methods not implemented in previous versions of the SDK?
      • From: Vyacheslav Karamov <email@hidden>
    • Re: The best way to call Cocoa methods not implemented in previous versions of the SDK?
      • From: Mike Abdullah <email@hidden>
  • Prev by Date: Re: NSBrowser column titles disappear when scrolled [SOLVED]
  • Next by Date: Re: The best way to call Cocoa methods not implemented in previous versions of the SDK?
  • Previous by thread: Re: Getting notification about new font is available
  • Next by thread: Re: The best way to call Cocoa methods not implemented in previous versions of the SDK?
  • Index(es):
    • Date
    • Thread