• 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: What is the equivalent of SetSystemUIMode() in Leopard and above?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is the equivalent of SetSystemUIMode() in Leopard and above?


  • Subject: Re: What is the equivalent of SetSystemUIMode() in Leopard and above?
  • From: Alastair Houghton <email@hidden>
  • Date: Wed, 27 Jan 2010 10:48:01 +0000

On 27 Jan 2010, at 05:36, Charles Srstka wrote:

> Or you could just do something like this:
>
> if(floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_5)
> {
> 	[NSApp setPresentationOptions:whatever];
> }
> else
> {
> 	SetSystemUIMode(whatever);
> }
>
> You could also use if([NSApp respondsToSelector:@selector(setPresentationOptions:)) if you prefer. I like to explicitly test for the version number though, so that once I *am* ready to say “10.6 and above”, it’s easy to search for and remove all the compatibility cruft that’s in there to make older versions work.

That's an interesting point.  Personally I prefer using -respondsToSelector: rather than version numbers, but I suppose it might be a good idea to stick a comment in a special form before the test; maybe something like

  // ###COMPAT 10.5
  if ([NSApp respondsToSelector:@selector(setPresentationOptions:)])
    [NSApp setPresentationOptions:whatever];
  else
    SetSystemUIMode (whatever);

It isn't something I've spent a great deal of time considering, and I know as a result we probably have some cruft in our code in places to deal with compatibility for versions of OS X we no longer support.

Kind regards,

Alastair.

--
http://alastairs-place.net



_______________________________________________

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: What is the equivalent of SetSystemUIMode() in Leopard and above?
      • From: Jean-Daniel Dupas <email@hidden>
References: 
 >What is the equivalent of SetSystemUIMode() in Leopard and above? (From: Arun <email@hidden>)
 >Re: What is the equivalent of SetSystemUIMode() in Leopard and above? (From: "Sean McBride" <email@hidden>)
 >Re: What is the equivalent of SetSystemUIMode() in Leopard and above? (From: Arun <email@hidden>)
 >Re: What is the equivalent of SetSystemUIMode() in Leopard and above? (From: Kiel Gillard <email@hidden>)
 >Re: What is the equivalent of SetSystemUIMode() in Leopard and above? (From: Jesper Storm Bache <email@hidden>)
 >Re: What is the equivalent of SetSystemUIMode() in Leopard and above? (From: Charles Srstka <email@hidden>)

  • Prev by Date: PDF View - smooth text?
  • Next by Date: Re: NSString category name collision?
  • Previous by thread: Re: What is the equivalent of SetSystemUIMode() in Leopard and above?
  • Next by thread: Re: What is the equivalent of SetSystemUIMode() in Leopard and above?
  • Index(es):
    • Date
    • Thread