Common Mac/iPhone development

Posts: 1
Joined: 2009.07
Post: #1
Hi all,

I'm new to Mac and iPhone development, and all I've done so far is absorb a couple books and a few blogs.

Well I have not found clear hints towards designing your app for both Mac and iPhone. Or, say, to minimize the amount of code which is to be redone for the second platform.

From my (limited) understanding, I gather that, given Model-View-Controller as the basic design pattern:
- Model objects: can of course be absolutely identical
- View objects: are of course different
- Controller objects: not clear how different they are, or better: can you structure your code to clearly separate out the "different objects"; use delegates ? use "categories" for slightly different methods ?

As a corollary, I sense that using Interface Builder and the lovely default controllers will ease your development for ONE of the platforms, but force you to redo all controller code for the second platform. So more hand-written code might be a better option ?

If any of you has already walked that path, I am interested by any hints.

Thanks in advance

PS: I will start with a simple book collection app, so nothing too fancy.
Quote this message in a reply
Posts: 312
Joined: 2006.10
Post: #2
Cocoa and CocoaTouch is very similar. For the most part, you will be able to (and will want to) keep all your model code the same, since it shouldn't know anything about the GUI (view and controller). There will be a lot of parallels between your Mac controller and view, the design and interface should pretty much all be the same, but the API (names) will obviously be slightly different between the two platforms (ie, NSButton vs. UIButton). You will have to make those changes and will have to recreate your interface builder files (XIB/NIB).

One last thing, most Mac OS X applications usually have a more advance GUI (ie, multiple documents), so obviously there will be a direct correlation between the complexity of your Mac OS X app's GUI (controller and view) and the complexity of the port.
Quote this message in a reply
Posts: 1,563
Joined: 2003.10
Post: #3
If you follow MVC strictly, you should definitely be able to have identical models and controllers across all platforms, and only have to reimplement views. Views can potentially have their own view controllers and view models, though, which would be view-specific and therefore platform-specific.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  iPhone game development coming funkboy 73 52,547 Jan 15, 2015 04:35 AM
Last Post: NuDeveloper
  Win a copy of: Beginning iPhone 4 Development: Exploring the iOS SDK @iOS_blog 0 4,342 Oct 1, 2011 04:23 AM
Last Post: @iOS_blog
  iphone 4 game development andynov123 2 8,790 Jan 18, 2011 01:27 AM
Last Post: JohnEdward
  Beginning Iphone game development collision lunayo 0 4,896 Oct 8, 2010 11:43 AM
Last Post: lunayo
  Problem with making a game with the iPhone Game Development book MrPenguin9 2 6,849 Feb 1, 2010 09:13 AM
Last Post: MrPenguin9