Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

HarryPot

macrumors 65816
Original poster
Sep 5, 2009
1,083
542
Hi, I'm wondering, where should one start in the path to learning how to develop Mac applications?

Should I start by learning Obj-C/Swift? Then Cocoa? Is Cocoa basically what Xcode is?

I've found many books for Obj-C and Cocoa, but none of them include Swift as of now.

So my question is, what is the very basic guide to get started in Mac programming?
 
Hi, I'm wondering, where should one start in the path to learning how to develop Mac applications?

Should I start by learning Obj-C/Swift? Then Cocoa? Is Cocoa basically what Xcode is?

I've found many books for Obj-C and Cocoa, but none of them include Swift as of now.

So my question is, what is the very basic guide to get started in Mac programming?

Start with Swift. It is a straightforward, easy-to-use language, which is also quite powerful. It is also going to replace Objective-C, so there is no point in your learning to use the latter when it will soon be obsolete.

Cocoa is a set of APIs (essentially, premade parts of a program) that Apple provides for our use. It includes things like buttons, text boxes, menus, windows, file and image handling, and so forth. Cocoa makes it easy to create a program with the “look and feel” that we expect from an OS X application.

You will need to learn some aspects of Cocoa to write programs for the Mac, but you won’t need all of it at first. First get a handle on using Swift in a playground. Once you’re comfortable with the basics of Swift, then look at an overview of Cocoa. Don’t try to delve in deeply, just get a handle on the different types of things that Cocoa provides.

When you’re ready to try your hand at a full-fledge Mac application, then you’ll know how to perform the logic in Swift, and you’ll have a good idea what Cocoa classes are likely to be useful.

Have you done any programming before?
If so in what languages?
Anything object-oriented?
 
Have you done any programming before?
If so in what languages?
Anything object-oriented?

Thanks a lot for the input.:)

I've been doing websites for some time now (I started around 5-6 years ago. I'm pretty good at HTML and CSS, and have now started to get into PHP a little).

But as for desktop applications, I have never got into it. I remember learning some VB and Fortran in college. It seemed pretty easy and I grasped it quickly, but that was around 4-5 years ago.
 
I see little to no point in learning any language that works on as few platforms as Swift or Obj-C. Python, Java, and JavaScript are the most cross platform languages - I'd recommend learning one of those instead. Python is the easiest of those I listed to learn... And is probably the easiest language to learn, period, amongst languages that are useful.
 
Thanks a lot for the input.:)

I've been doing websites for some time now (I started around 5-6 years ago. I'm pretty good at HTML and CSS, and have now started to get into PHP a little).

But as for desktop applications, I have never got into it. I remember learning some VB and Fortran in college. It seemed pretty easy and I grasped it quickly, but that was around 4-5 years ago.
Glad to help. :)

Have you worked much with JavaScript? That is pretty much the programming language of websites. If you have, then you’ve got a leg up, but even if not it’s not big deal.

As for the best place to start, and tutorials, I can’t say for certain. There’s the official Apple Swift website with guides and videos and reference documents. There’s weheartswift.com, which has a “Learn Swift from scratch” page. There’s Apple’s official Swift iBook. And you can find plenty of tutorials by Googling.

Regardless, you are going to need Xcode, which is Apple’s IDE (basically, a program for programming) and includes all the nuts-and-bolts requirements for actually creating a Mac application.


Hi, I'm wondering, where should one start in the path to learning how to develop Mac applications?

Python, Java, and JavaScript are the most cross platform languages - I'd recommend learning one of those instead.

Ahahaha, thanks for that, I needed a good laugh. “What’s the best language for Mac apps? Python.” Ohohoho you are too funny!
 
If your goal is making apps for Mac and/or iOS then certainly Objective-C and/or Swift are standard languages. Sure, there its possible to use other languages but most folks stick to Obj-C/Swift unless there's a compelling reason not to.

Python, Java etc seem like strange *first* choices of language to me if you're looking at developing Mac/iOS apps. However, if your goal is learning programming generally and you may want to branch out into developing for other platforms in the future then there may be some merit in investigating those.

I'm a great fan of the tutorials here:

http://www.raywenderlich.com

Good luck!
 
Last edited:
Clarification

Xcode - development environment. This is where you type your code, set up the visible interface, set the icon, and other stuff. If you want (and know what you're doing), you can toggle and set thousands of compiler and link flags here.


Swift / Objective-C - programming languages. This is what you program in. If you're writing Macintosh, iPhone, or iPad apps, realistically these are the only two programming languages available. This is where you say stuff like
Code:
let countOfFederation = countOfHumans + countOfKlingons
or
[[UIView alloc] init];


Cocoa / CocoaTouch - application program interface. This is Apple's secret sauce that allows your programs to look like Apple programs. There is a tremendous amount of pre-written code here, so you can just call an API to get a button or sort an array in a few lines of code, rather then writing a couple hundred/thousand lines yourself.
 
Thanks again for the info.:)

Have you worked much with JavaScript? That is pretty much the programming language of websites. If you have, then you’ve got a leg up, but even if not it’s not big deal.

I have worked with some Javascript, but far from being an expert.

As for the best place to start, and tutorials, I can’t say for certain. There’s the official Apple Swift website with guides and videos and reference documents. There’s weheartswift.com, which has a “Learn Swift from scratch” page. There’s Apple’s official Swift iBook. And you can find plenty of tutorials by Googling.

I started reading the Swift tutorial from Apple. It's good, but it do supposes a certain prior knowledge from the reader. Still, by trial and error I feel I can use it to learn and will eventually serve me better than an extremely basic book.

------------------------

I must say I've been entertaining the idea of not learning to program for Mac and just continue with PHP/Javascript and maybe eventually Ruby.

And just center on making web applications. Sometimes I feel as if everything is going on that direction.

But I love the Mac, so the geek in me wants to make Mac applications.:p
 
But I love the Mac, so the geek in me wants to make Mac applications.:p

That’s the spirit!

If you can pace yourself and try things out in a Playground (open Xcode, make a new playground), then you should get the hang of Swift pretty fast. Don’t let yourself get overwhelmed, just do a little at a time and steadily expand your repertoire.

I think my recommendation would be to follow along with Apple’s Welcome to Swift documents. They even have pre-made Playgrounds you can download, follow along, and experiment with!

Don’t try to go too fast, and don’t try to memorize everything. You’ll get the hang of it in no time. And feel free to ask here if you have any questions, either conceptual or syntactic. :)
 
I must say I've been entertaining the idea of not learning to program for Mac and just continue with PHP/Javascript and maybe eventually Ruby.

Ruby via RubyMotion can be used to develop applications for OS X, iOS, and Android. Whatever you decide to use, you will also need to spend some time learning about the languages used by the various APIs (Objective-C, Java, etc), since that is what they are written in.
 
I must say I've been entertaining the idea of not learning to program for Mac and just continue with PHP/Javascript and maybe eventually Ruby.

And just center on making web applications. Sometimes I feel as if everything is going on that direction.

But I love the Mac, so the geek in me wants to make Mac applications.:p

You are correct that everything is moving to the web. Unity 5 was recently released - it allows you to make 3D games that run in Safari on iOS. 3D games are generally accepted as the most intensive computing of what a non-professional is going to be doing with a program. And mobile web browsers can handle it.

It's only a matter of time before even the professional stuff, like 4K video editing with real time rendering/viewing, is done on a website, I imagine.

What makes something a "Mac application"? I think you'd agree with me that all things on the Mac App Store are Mac applications, right? You can put Python apps on the Mac App Store (via py2app). You can put JavaScript apps on the Mac App Store. I'm sure there are other languages you can use, too, even if these languages aren't particularly well supported by Xcode.
 
To make Mac applications, learn the native OS X frameworks (Cocoa) and Swift. You may discover that you need to fill in with some Obj-C or even C later on, but start out with Swift. At this point I think that's the right place to start.
 
Do not start with Swift. My rule is to only start with a new tool when there are at least 10 beginners books on the topic (plus a lot more advanced books), because only 10% are likely to be both good and suitable for your level.

Start with something like Python or Javascript. You can create applications that will run on OS X using either.
 
I see little to no point in learning any language that works on as few platforms as Swift or Obj-C. Python, Java, and JavaScript are the most cross platform languages - I'd recommend learning one of those instead. Python is the easiest of those I listed to learn... And is probably the easiest language to learn, period, amongst languages that are useful.

Actually the most cross platform language is C.

There are tons of platforms that have no Python, Java or JavaScript implementations. I can name two without even trying. AVR and PIC.
 
Actually the most cross platform language is C.

There are tons of platforms that have no Python, Java or JavaScript implementations. I can name two without even trying. AVR and PIC.

Matbe not a Python interpreter, but I'd be willing to bet money that there's a JavaScript interpreter and JVM for each of those.

JVMs, and interpreters for each of Python and JavaScript are normally written in C. So if they haven't already been compiled for those platforms (and I'm willing to bet money that they have been), it's trivial enough to do it yourself.
 
You won't get far without knowing objective c. Basically, the whole framework is in objective c, most examples are in objective c, and most serious libraries and code examples. The whole Cocoa API is in objective c. Start there. When Apple starts building parts of the framework in Swift, or any serious apps, then learn it.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.