Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Developing for OS X coming from iOS background [closed]

I have been developing solely for iOS for a fair few years now and consider myself to be fairly competent with iOS and Objective C. I would like to further expand my skills and move into the realm of desktop applications for OS X.

Considering the hugely different paradigms for both platforms concerning view controllers and window controllers (to name a few), I am struggling to find a decent starting point to get my feet wet as my knowledge of the iOS SDK is causing confusion when reading through the OS X documentation.

To me, the major classes for iOS would be UIViewController (and it's variants, UINavigationController and UISplitViewController) and UIView. Getting to grips with these makes learning their subclasses (such as UIButton, UITextField) easier to understand whilst also getting something up on the screen to provide visible results.

Currently, it is my understanding that NSViewController is not necessarily the same counterpart to UIViewController. Also, considering that OS X applications can have multiple windows, UIWindowController is completely foreign to me and I do not understand how this would sit within the hierarchy of an application.

Would any seasoned OS X veterans be kind enough to suggest which classes would be the most useful starting point for me to read up on and play around with? What would be helpful to me at this point is to find which area of the SDK I should be focusing my efforts on to fully discern the differences between iOS and OS X.

Edit:

I am not asking for a list of tutorials. I would much prefer for someone to explain either the difference between paradigms for a multiple view controller hierarchy (iOS) to a single window setup of OS X and/or recommend which classes would be best investigated as a starting point to get something on screen such as NSWindow and NSWindowController.

like image 534
Zack Brown Avatar asked Sep 02 '13 08:09

Zack Brown


People also ask

Is iOS necessary for Mac development?

Developer RequirementsTo develop iOS apps, you need a Mac computer running the latest version of Xcode. Xcode is Apple's IDE (Integrated Development Environment) for both Mac and iOS apps. Xcode is the graphical interface you'll use to write iOS apps.

How do you stop apps from closing in background iOS?

– Please make sure Background App Refresh is enabled for the app. You can find it under device Settings -> General -> Background App Refresh switch.

How do I stop my Mac from updating in the background?

Click on the menu icon in the top right of the tool bar and select Options. Then click on Advanced and select "Never Check for Updates" or "Check for updates, but let me choose whether to install them".

What can iOS apps do in the background?

Background app refresh is a feature of iOS and Android that allows apps to update their content from the internet, even while you're not using them. In contrast, we say that apps use data in the foreground when you open and use them yourself.


1 Answers

OS X is pretty similar to iOS in the regard that it also follows the MVC concept. However, the whole user experience is different due to the fact that OS X usually works with a larger display and uses mouse and keyboard for the input, so a 1:1 mapping between let's say NSViewController and UIViewController isn't possible. Normally, you have window controller which kinda acts as you would expect your view controller to under iOS. However, instead of transitioning between view controllers, using eg. a UINavigationController, you either present a second window as a modal sheet, or you just open it as panel or similar.

Just look at your average Mac application, most things that under iOS require multiple view controllers and transitions between them, work with just a single window which contains everything. View controllers under OS X are much less useful than under iOS, however, they work great to keep different logic split up in multiple classes, or when you want to display different content within a window and change between that (think of Xcode, the left and right pane are always the same, but the content in the middle, text editor, target editor etc, changes. That would be a place to use multiple view controllers).

My advice would be to not try to iOS'fy a Mac application. While you can keep your underlying logic the same, the presentation of your application should be fundamentally different due to the fact that the whole user experience on OS X is vastly different. If you aren't sure how to work with things like NSWindowController, NSDocument, and everything, the documentation and sample code provided by Apple is in most cases pretty darn good (though, some examples are older)

like image 138
JustSid Avatar answered Oct 16 '22 19:10

JustSid