Chapter 6. Cross-Platform Programming
In the last chapter, you learned how to provide users with Mac OS X features “on the fly,” depending on what platform an application runs on. While that chapter focused on menuing options, you can apply the same techniques to any of the other Mac OS X features (such as QuickTime or Spelling, both discussed in future chapters). However, you need to consider a lot of other issues when writing a cross-platform application. While some techniques require code to determine what platform is used, others are simply good programming practices that make any application run better, on any platform.
This chapter, then, is a mixed bag of suggestions and tricks. It’s organized by problem area: each section deals with one particular aspect of cross-platform programming. Generally, these are areas of concern where things can go wrong if you aren’t careful. Occasionally, you may see some general programming tips mixed in with them, as good development practices often take care of many of these issues implicitly.
GUI Construction
Chapter 4 covered this topic in detail, but it’s worth reviewing. Generically, for maximum cross-platform compatibility, stick with the Metal look and feel, and perform sanity checking to ensure that the user interface operates correctly on both platforms. For the best performance (and user experience) on Mac OS X, however, be sure to let users run the application with the Aqua look and feel. Doing so involves using appropriate fonts ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access