With the recent launch of the Apple Desktop App Store we have received a lot of questions from our clients. What is the difference? Can we reuse our iPhone app code since it is Objective-C? What is Cocoa and Cocoa Touch? The short answer is you need to rebuild you app but here is a more technical breakdown…
Objective-C is a language, while Cocoa and Cocoa touch are frameworks.
Cocoa is the combination of the Foundation and AppKit frameworks, Cocoa Touch is the combination of the Foundation and UIKit frameworks. Cocoa and Cocoa Touch sit on top of other collections of frameworks to create the API stacks. The other layers are Media, Core Services and Core OS.
In iOS, the UIKit framework provides the infrastructure for building graphical applications, managing the event loop, and performing other interface-related tasks. The UIKit framework is completely distinct from the AppKit framework. Therefore, when migrating to a Cocoa application, you must replace a significant number of interface-related classes and logic. Anything that starts with UI… Like UITextField would be changed to a NSTextField as a simple example. Many of the classes share that similar functionality and can be ported by changing the class name, but most of these ports will require some more changes. For portable elements we must consider if we should start backwards and modify or if it will be more efficient to start fresh using the existing application as a guide. Other elements like the media must be recreated for the Mac OS media layer.
Here are some more details that you can review, it is written in terms of an cocoa to cocoa touch port. I’d say it is a fair description but also aimed to put developers at ease. It might be a little more than the client will want but it good to understand. I’d say the most valuable elements that can be reused from most projects are the data model and our project familiarity.