From iPhone to Mac programming

后端 未结 3 1293
孤街浪徒
孤街浪徒 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).

提交回复
热议问题