Dev Juice: Help me leverage Lion-only features
Dear Dev Juice,
I'm part of a tiny company developing iOS apps. We're about to develop our first Mac OS X app. There are many cool new features in MAC OS X Lion and we'd like to take advantage of these. However, this would mean only people on Lion could use our app... Do you think most people have upgraded to Lion? Or do you think we'd be ignoring a lot of potential users still on Snow Leopard?
Gareth

Dear Gareth
Lots of users have made the jump to Lion but lots more have not. Rather than jumping on the Lion bandwagon completely by providing a Lion-only application, consider conditional coding instead.
Conditional coding allows you to offer certain features only to Lion users while ensuring the application remains both 10.6 and 10.7 ready. This solution allows you to build your application for the greatest number of users.
Make sure you clarify in your marketing text that certain features are Lion-only so you don't tick off either Apple or your user base.
Here are a few conditional coding hints.
- Check for properties using key/value coding. If valueForKey: returns nil, the property is not available in Snow Leopard.
- Check for classes using NSClassFromString(). Code around non-existent classes in Snow Leopard by disabling features or removing inappropriate options.
- Check for selector compliance using respondsToSelector:. When newer APIS are supported, objects will report that they respond to those selectors, letting you call them without crashing the program. You may generate compile-time warnings about unimplemented selectors unless you use work-arounds like performSelector:withObject:. If you really want to go hard core, you can build NSInvocation instances directly.
Happy Developing!
Share
Source: http://tuaw.com/tag/devjuice
Categories
Dear Dev Juice, I'm part of a tiny company developing iOS apps. We're about to develop our first Mac OS X app. There are many cool new...
Add a Comment
Lion broke my Mono based app - NOT HAPPY! This would never happen on Windows.
August 31 2011 at 8:41 AM Report abuse Permalink -1 rate up rate down ReplyDropping support for Snow Leopard this year is foolhardy. Many production computers haven't been upgraded yet because Lion is still too buggy, major Apps still have issues with it, and Lion has security issues as well. Even Apple is still bringing iCloud support to 10.6.x down the road if that's any clue. Apple even gets it, so take their lead and make sure you keep up with 10.6.x or you'll lose customers and lots of them will be pros that have the money you want.
August 30 2011 at 2:51 PM Report abuse Permalink +1 rate up rate down ReplyI'd say that it isn't worth supporting an old OS for new development. It makes more sense to try to keep backwards compatibility using weak linking tricks as long as possible after it is initially deployed. You can always back-port later if it appears some of your market doesn't like to update. If this is a document based app, it is especially important just to target Lion for the first release or you will give Lion users a subpar experience.
August 29 2011 at 7:46 PM Report abuse Permalink -1 rate up rate down Reply> There are many cool new features in MAC OS X Lion
First thing to do is learn how to spell the OS you're targeting. It's Mac, not MAC. Grrrrr
I've been using respondsToSelector: for properties as well. That works too, right?
August 29 2011 at 6:36 PM Report abuse Permalink rate up rate down ReplyYep, as properties are still still powered by methods/selectors.
September 01 2011 at 10:04 AM Report abuse Permalink rate up rate down ReplyDeals of the Day
more deals- Acoustic Research Digital Photo Frame with iPod Dock for $50 + free shipping
- Apple iPhone 4 8GB for Verizon, AT&T, or Sprint for $50 + pickup at Best Buy
- Unlocked iPhone 4S 16GB for GSM (AT&T, T-Mobile) for $619 + free shipping
- Apple iMac Core i7 Quad 3.4GHz 27" w/ 24GB RAM, 2TB HDD for $2,677 + $29 s&h
- Used Apple Magic Mouse for $36 + $4 s&h
- Skullcandy Riot Earbud Headphones for $10 + free shipping
6 Comments