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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to