From iPhone to Mac programming

后端 未结 3 1262
孤街浪徒
孤街浪徒 2020-12-29 13:20

I\'ve looked through the site to make sure this isn\'t a duplicate. Apologies if I\'ve missed something.

I\'ve been doing iPhone development for about a year now, an

相关标签:
3条回答
  • 2020-12-29 13:58

    Thankfully, Cocoa on the desktop and Cocoa Touch are very similar. I would recommend just downloading some beginner sample code from Apple's website. Since you already know Objective-C/Cocoa, you should be able to follow along pretty easily. If some parts are confusing, you can skim through Apple's guides.

    Things that are the same:

    • Design Patterns (target/action, delegate, data source, first responder, etc.)
    • Objective-C
    • Interface Builder

    Things that are different:

    • A control can have only one target and action. On the iPhone, you can have one target/action for a touch up inside, touch up outside, etc. On the Mac, there's only one.
    • NSWindowController for loading xibs (conceptually similar to UIViewController, though)

    Edit: Overall, the main different the iPhone has more 'pre-built' UI classes (UINavigationController, UITabBarController, etc.) you can use in your app to make it look nice and pretty (and most importantly, consistent with Apple apps).

    0 讨论(0)
  • 2020-12-29 14:05

    I started out with Mac OS development and went to iPhone development. You probably already know the core concepts about how the APIs work. The biggest problem I see developers who transition from iPhone to Mac is getting used all the subtle ways that Mac users expect their apps to work. Things like handling the Page Up and Page Down keys to scroll your view (shame on Tweetie for not supporting this). Or handling multiple windows. Or multiple display sizes (and making sure not to position windows off screen).

    For the technical programming questions, Apple's own documentation is the best place to start. For the nuances of designing for the Mac OS and doing things right, there isn't a book or web site that has all the answers, as far as I know. Mostly that comes from using apps that are Apple Design Award winners and imitating what they do.

    0 讨论(0)
  • 2020-12-29 14:08

    While the iPhone development evironment isn't strictly a subset of the Mac, since there are some improved and iPhone-specific bits, it is nearly so (and it's mainly the good bits). Thus, the Mac is probably the easiest platform to move to from iPhone.

    On the Mac, you will especially want to learn about Cocoa Bindings, which underly a lot of modern UI work, but aren't (yet) on the phone.

    Addressing your specific question, some well-respected free Mac coding resources include:

    • the canonical cocoa-dev mailing list run by Apple (which, unfortunately, has only the woefully lame web access implemented by Apple, and sporadically augmented by unreliable third-party efforts, making it mostly useful via actually subscribing to it from one of your email acccounts)
    • the CocoaDev wiki
    • Rogue Amoeba's Mike Ash has an unusually useful Q&A Fridays series on his blog
    • the advanced Mac programming book from Aaron Hillegass, Advanced Mac OS X Programming
    • although Apple's docs are pretty good now, in the bad old "description forthcoming" days, a lot of us learned how Mac OS X ticked from open-source code published by reputable software houses, like Omni's frameworks which you are free to embed as-is into your apps, or cherrypick code from

    (Hmm, I don't usually post here, so I was prohibited from hyperlinking the above references... can I put them in as text? Uh, nope! Well, there's always google, I guess.)

    0 讨论(0)
提交回复
热议问题