Information Technology Reference
In-Depth Information
In theory, you can migrate projects between platforms. In practice, Cocoa on OS X and Cocoa Touch on iOS
have so many differences that dual-platform development of a non-trivial application is either challenging or
unrealistic.
Currently iOS and OS X applications have distinct markets and partially distinct distribution models. Although
a few applications have appeared on both—social networking tools and games are the most popular
choices—Xcode does little to simplify the development of multi-platform projects.
The development workflow is almost completely distinct. The two platforms have these features:
A separate collection of classes for UI design and for data management: Many of the more creative
and sophisticated classes in OS X are either absent or only partially implemented in iOS.
Aseparate testing and debugging environment: iOS applications can run in a Simulator or on a hard-
ware device. OS X applications run in a debugging sandbox.
A different core programming model: iOS supports task switching with very limited multi-tasking, and
limited access to the device file system. OS X supports a wider range of multi-tasking options, and less re-
stricted access to files.
Separate documentation suites: iOS and OS X have separate collections of documentation and distinct
source code examples.
Different accelerated graphics frameworks: OS X implements OpenGL in full, iOS implements the
simpler OpenGL ES framework.
Different project templates for separate bare-bones starter application sketches: iOS includes a set
of sketches for simple UI-driven handset apps. OS X includes a more complex collection of templates that
support the development of plug-ins, screen-savers, and other libraries.
A partially distinct set of supported instruments for testing: Limited overlap exists, but some instru-
ments remain unique to each platform.
Apple's Model-View-Controller design pattern implies that applications should keep UI designs, UI manage-
ment code, and underlying data collections distinct. OS X includes controller classes that make it easier to man-
age data and create UIs to work with it. Most of these classes are absent in iOS. This makes it difficult to use
MVC effectively when attempting dual-platform development.
If you plan to develop across platforms, try to package the underlying data model into its own collection of
classes. You may be able to reuse these classes without major changes. Keep UI and UI management code else-
where.
Generally, combined iOS and OS X remain possible but difficult. It's more realistic to think of Xcode 4 as two
separate development environments with a common frontend than as a single unified environment designed to
produce code for either platform.
Summary
This chapter explained how previous Mac development tools led to Xcode, listed the key design goals of Xcode
4, and summarized the key differences between Xcode 4 and Xcode 3. It introduced some of the practical differ-
ences in more detail and looked at some of the new features. Finally, it explored the fundamental differences
between iOS and OS X development and briefly discussed how those differences affect the development work-
flow.
Search WWH ::




Custom Search