views:

257

answers:

8

Hi.

I'd like to learn how to write application for Mac OS X.

Like how to use XCode properly, Cocoa syntaxes and examples, etc.

I'm already a web developer using ruby, php, mysql, rails, etc.

I looked through google quite some times but never found something palpable to learn from.

But I really want to make my own application, for fun and maybe business later.

Thanks a whole bunch for your tips!

+7  A: 

You should start by learning Objective-C. Programming in Objective-C is an excellencent introduction to the language

If you're looking for a free resource this is an excellent web-site

Only after you have a solid understanding of the language would I worry about the different frameworks available.

ennuikiller
Apple's Document describing Objective-C is also quite good: http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/ObjectiveC/Introduction/introObjectiveC.html
Pinochle
+12  A: 

Aaron Hillegass's book "Cocoa Programming for Mac OS X" is certainly up there. It would also be well worth your time to learn the C language well.

Stephen Canon
Definitely second that vote! But again a solid understanding of Objective-C will make going through Hillegass's book a lot smoother
ennuikiller
Great, I've just ordered both of those books, thanks a lot for the tips! Any other resources will be welcomed as well!
Tom
+1 on both this and the Kochan book. You may want to start with the Kochan book if you haven't programmed in C before; Aaron's book picks up where Kochan leaves off. An even better resource if you have some cash is Aaron's Cocoa class at Big Nerd Ranch. bignerdranch.com
Rob Napier
A: 

Check out Apple's Developer Documentation, which seems to be getting more and more attention over time, and has become quite good for beginners to start with.

Pinochle
+2  A: 

The first thing I would start with is Automator. In fact, it's what I did start with. Solve a couple of easy problems with it, like renaming iTunes songs or photo manipulation. In the process, you'll probably think of an action you want that's not included. You can write it yourself using AppleScript.

Now you've got the basics of two desktop programming systems for MacOS in about a day. It might seem silly to learn these two super-basic systems, but in the process you'll learn the flow of desktop development and get a couple of "quick wins" in before you move on to XCode. You'll begin to think of your Mac as more than just a web client.

If I were you, I'd check out RubyCocoa next. It's a language you're already familiar with, so you'll be able to score another couple of wins here, too.

When you're ready to take on Objective-C, Cocoa Is My Girlfriend is a great introductory resource.

Chris McCall
Sweet, I like the way you learnt that and I really think it's a good way of learning. I'm really used to Automator, and I did a little AppleScript sometime ago, but I'll give it back a go.But a question I want to ask is: What's the pros and cons about using RubyCocoa instead of just plain Cocoa? Isn't it a layer over cocoa? Thanks!
Tom
I question the value of learning Automator and AppleScript. They're great introductions to coding, but for someone that has already written web applications, it seems a little pointless.
andyvn22
On RubyCocoa: Pros: you already know Ruby. Cons: the Cocoa API was really designed with Obj-C in mind, and doesn't feel quite right in from other language. If you're looking to make something soon, go ahead and use RubyCocoa, but Obj-C is Cocoa's One True Language.
andyvn22
@andyvn: Automator only seems pointless until you start using Automator's Developer actions to automate your XCode builds, which is very powerful. Applescript is an ancient MacOS scripting tradition and most Mac programmers will end up writing some of it anyway. May as well learn in the proper order. Both of these technologies provide for easy wins right off the bat, hopefully keeping Tim from feeling discouraged like a lot of developers learning MacOS desktop development.
Chris McCall
Whoops, "Tom" not "Tim". Anyway, --Tom--, I suggested RubyCocoa because the MacOS stack has a lot of technologies and tools you could try to learn simultaneously, in the "Deep End", so-to-speak, but my learning style makes it easier if I break the knowledge space into chunks, starting from easiest to hardest. XCode/InterfaceBuilder, Cocoa, Obj-C, each of those is its own beast. If you can isolate the parts and focus on one at a time, I think you may be more successful.
Chris McCall
+5  A: 

To jump right in as quickly as possible, I'd recommend going through the following Cocoa Dev Central tutorials:

  1. http://cocoadevcentral.com/articles/000081.php (C)
  2. http://cocoadevcentral.com/d/learn_objectivec/ (Obj-C)
  3. http://cocoadevcentral.com/d/learn_cocoa/ (Cocoa part 1)
  4. http://cocoadevcentral.com/d/learn_cocoa_two/ (Cocoa part 2)
  5. http://cocoadevcentral.com/articles/000082.php (Style part 1)
  6. http://cocoadevcentral.com/articles/000083.php (Style part 2)

Once you've read those, you should be able to do quite a bit on your own, just using the documentation in Xcode (option-double-click on a class name in Xcode) and Apple's developer site.

andyvn22
+1  A: 

I would start with the currency converter sample Apple provides.
This gives a nice introduction to Xcode and Interface Builder.
You could then try to implement the same basic application but with bindings.

As you seem to have experience in some interpreted languages, you may have troubles with the memory management in Objective-C at the beginning.
You can turn on Garbage Collection to make your life easier.
If you want to use your knowledge to create iPhone apps, you should learn the memory management concepts as there is no garbage collector available on the phone.

The podcasts on the Mac Developer Network also contain some good information.

weichsel
A: 

Standford recently put out a course on iTunes U that teaches you how to program on the iPhone. Because the iPhone uses the same programming language as OSX, a lot of what they talk about can be transferred to Mac app development. Best of all, the course is free to download and watch, and has a bunch of sample material that goes along with it. Click the link below to open it in iTunes.

iPhone Application Programming

Elliott Bowles
+1  A: 

I was in the same situation some time ago, struggling to learn mac dev, read a lot of books, and it was hard for me to retain all that information, but I stumbled across CocoaCast where you can find lots of video tutorials on Mac Development! And it's totally free to watch them, even to download them.

Woofy