Quote:
Originally Posted by tazboy
I'm currently programming for iPhone. I've watched some videos on how to make that code work with the iPad without a lot of extra coding. Does that seem like a fair assessment? What about if I wanted to make a Mac app, could I reuse a lot of the same code from the iPhone app?
|
Programmatically, and iPad really is a giant iPod touch, with a few extra controls added (split view controllers and popovers.) It's not hard at all to write "universal" apps that run on iPhones and iPads both, and adapt perfectly to each.
Mac OS is fairly different. There are no view controllers, for example. You work with windows and documents. Your document object tends to be the brains of your application. To get an idea of how different Mac OS is: If the class name starts with "UI", it doesn't exist in Mac OS.
The file system is nearly identical, the data structure classes are nearly identical. Core Animation is nearly identical at the layer level, but the way it interacts with windows and views is quite different.
Some of the lower level data and communications classes are different as well. NSURLConnection, for example, is a little different, and there is a class NSURLDownload in Mac OS that handles asynchronously downloading remote data directly to a file.
As the other poster said, if you follow the MVC design pattern, and carefully keep your user interface separate from the code that does the communications/data processing/file system, you can share good-sized chunks of your code between platforms. Expect to have to completely redesign the user interface, however.