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?
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.
Software Updatesmore updates
- Apple Remote Desktop updated with Yosemite support
- OS X Yosemite 10.10.2, iOS 8.1.3 updates now available
- Sports Illustrated 120 SPORTS channel comes to Apple TV
- Logic Pro X update brings AirDrop support, new effects, tools, and more
- Parallels Access 2.5 released, adds file manager, computer-to-computer remote access
- The Google Translate iOS app is about to get a lot smarter