Cocoa Programming for Mac OS X (3rd Edition)

Category: Operating Systems
Author: Aaron Hillegass
4.1
All Stack Overflow 58
This Year Stack Overflow 6
This Month Stack Overflow 2

Comments

by anonymous   2019-07-21

I learnt using this book:

http://www.amazon.com/Cocoa-Programming-Mac-OS-3rd/dp/0321503619

It's really fantastic and covers everything you'll need for making Cocoa Apps. A lot of the stuff you'll learn there is directly transferable to writing iPhone apps.

Another thing you can do is find a few open source iPhone apps to learn from, a good place to start would be http://www.appsamuck.com/, they have a bunch of examples apps you can take a look at.

If you're just looking for an obj-c language guide Apple has a pretty good one:

http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Introduction/introObjectiveC.html

by anonymous   2019-07-21

One of the best books is Cocoa Programming for Mac OS X 3rd edition by Aaron Hillegass. That will get you started in learning Objective-C. That would be a good investment to see if you like how Objective-C and Mac OS X programming is.

http://www.amazon.com/Cocoa-Programming-Mac-OS-3rd/dp/0321503619/ref=sr_1_3?ie=UTF8&qid=1295977786&sr=8-3

by Jonathan   2019-07-21

I would heartily recommend Aaron Hilegass's book Cocoa Programming for Mac OS X. It took me from feeling like everything was impossible to being relatively competent in the space of a few short weeks. I was very impressed with it.

Apple's documentation is amazingly good, but it takes a while to get used to the style, and you will need to know which objects actually exist before you can look up how to use them, which is where Aaron's book comes in.

Your library may have a copy of it, or be able to order one for you if they don't.

by anonymous   2019-07-21

When you create a Cocoa Application you get the choice of creating a 'Cocoa Application' or a 'Cocoa Document-Based Application' The Cocoa application is not document based sostored data in one location for a user. Examples of this are iPhoto and iTunes - there is no concept of documents in these applications but there is differnt data for differnt users.

Core Data would still be a good choice for non document based applications - it's just that the Core Data DB would be used every time for a given user.

Aaron Hillegass Cocoa Programming is a great Cocoa book.

by Jonathan   2019-07-21

Cocoa Programming for Mac OS X by Aaron Hillegass

by anonymous   2017-08-20

For this to work, you have to create a plug-in for Interface Builder that uses your custom control's class. As soon as you create and install your plug-in, you will be able to add by drag and drop, instances of your view onto another window or view in Interface Builder. To learn about creating IB Plugins, see the Interface Builder Plug-In Programming Guide and the chapter on creating your own IB Palette controls from Aaron Hillegass's book, Cocoa Programming for Mac OS X.

Here is the link to the original author of the accepted answer to a similar question.

by anonymous   2017-08-20

I've taught Cocoa programming to several Windows-experienced programmers. You may find a previous post on the subject useful.

Cocoa is a very different way of thinking then MFC and its kin. You will do much, much better if you take the time to learn how Cocoa approaches things and adapt to its mindset rather than trying to find the quickest way to implement your current way of thinking in ObjC. It is possible to write MFC-style code for Mac, but you will always be fighting the framework if you do. I've seen a lot of Windows developers struggle with this.

The best book to learn Cocoa is Cocoa Programming for Mac OS X. Assuming you are a C++ developer with a solid OOP background, this is the book to start with. If you have limited Object Oriented background, then start with Programming Objective-C 2.0.

You would be amazed how fast Objective-C can be to code once you understand the patterns. It really can be stunning compared to C++ in my experience. There are more RAD-like systems like REALbasic, and you can develop Cocoa apps in Ruby now which can be a bit quicker. But there really is no substitute in the Mac market for ObjC. It's hard to make an app that works like a Mac app without using the Mac frameworks, and Mac users tend to be much fussier about such things than Windows users.

I have no background in LispWorks, but LISP seems a terrible language for developing the kind of rich UIs that Mac apps are known for. I like LISP (quite a lot actually), but Functional Programming's "no side effects" philosophy seems at odds with most rich UI goals (especially as the Mac UI becomes more and more animation-centric). If anything, Mac programming is moving towards Declarative rather than Functional programming (Core Animation and Grand Central Dispatch have a lot of Declarative concepts creeping in).

There is not as large a third-party component market as there is for Windows. Some of this is because Cocoa already provides such a rich set of components, which MFC does not, and because well-behaved Mac apps are expected to use those components so that you work like all other Mac apps. There is definitely little market for commercial components in the vein of RadControls for .NET (very nice toolkit, that one). But there are quite a few nice free components out there with flexible licenses (generally MIT-based). A few of my favorites:

  • Positive Spin Media's excellent tabbar control
  • OmniGroup's frameworks (though I never use them "as is;" they're better used as examples of how to do things)
  • Growl
  • Sparkle
  • RegexKit
  • CocoaDev's ObjectLibrary list of other stuff

As I mentioned before, Mac users are picky about their UI. Much, much more so than Windows users. They expect things to be polished, and they expect things to integrate with all the little things that make Macs nice. That means drag-and-drop, Spotlight, services, Applescript, Expose, QuickLook, integrated spelling check, etc. etc. It's very hard to do all these things right if you don't use the built-in frameworks. That's why I recommend new Mac developers start at the beginning and learn the frameworks.

For a Mac, if you have a bunch of hardware lying around (like keyboards and monitors), then a Mac Mini is a nice cheap box. iMacs are great if you want an all-in-one, and any MacBook is appropriate if you like portability. There is no Mac on the market today that is not a perfectly fine development box. Obviously if you do a lot of work, an 8-core Mac Pro makes compiling much faster, but I've done a lot of professional development on a 13" MacBook. If you want to get in as cheaply as possible, look for refurbished or used (I love my refurbished Mac Mini). Any Intel-based Mac is going to be fine for development, at least while you're getting started.

by anonymous   2017-08-20

Suitable book to pick up and learn from.

What blogs I should follow?

  • Scott Stevenson
  • Wil Shipley
  • Cocoa is my girlfriend

Any code example I should look at to learn from.

  • Apple's Currency Converter tutorial
  • Apple's Currency Converter tutorial with cocoa bindings

EDIT: There is already a comprehensive list here on SO: Good ways to Learn Cocoa?

by anonymous   2017-08-20

The search box is your friend :) There is a great discussion here: Howto Articles for iPhone Development Objective-C

Personally, I'd suggest starting with Aaron Hillegass' Cocoa Programming for Mac OS X and then read Beginning iPhone Development by Dave Mark and Jeff LaMarche.

Apple has a lot of resources on their site: iPhone Dev Center

by anonymous   2017-08-20

Here's what I did (I come from a Java/C++ background):

Starting off

That should get you reasonably up to speed and developing basic applications. (I have not seen the Stanford video lectures yet, but I think that's a very good way to start too)

Getting better at it

  • To get a good understanding of Cocoa concepts, I've found the best resource to be the Apple Programming Guides. You should definitely read these. They have one on almost every topic, from NSStrings to Objective 2.0 properties, the memory model etc. You will find these in the XCode documentation. (If you're looking up a class reference etc. you will find the associated programming guides listed in the left sidebar)
  • Apple sample code: You'll find this again at http://developer.apple.com. You can reuse and/or adapt these.

You should be up and developing applications by now. If you're stuck or need advice, here are some additional resources:

What to do when you're stuck

  • The Cocoa-Dev mailing list (This is not Cocoa-touch specific per se, but I've got some very good answers from here)
  • The Apple discussion forums
  • IRC

(I'm not sure if the above resource list is good enough -- but others can correct me)

by anonymous   2017-08-20

For this to work, you have to create a plug-in for Interface Builder that uses your custom control's class. As soon as you create and install your plug-in, you will be able to add by drag and drop, instances of your view onto another window or view in Interface Builder. To learn about creating IB Plugins, see the Interface Builder Plug-In Programming Guide and the chapter on creating your own IB Palette controls from Aaron Hillegass's book, Cocoa Programming for Mac OS X.

Here is the link to the original author of the accepted answer to a similar question.

by brianwillis   2017-08-19
I started out developing for the Mac with "The Objective-C Programming Language" but found it clumsy and kind of dense. In my opinion "Cocoa Programming for Mac OS X" by Aaron Hillegass (http://www.amazon.com/Cocoa-Programming-Mac-OS-3rd/dp/032150...) is much better in the way it introduces concepts, and flows from chapter to chapter. Well worth the investment if you're serious about developing for the Mac.
by ddagradi   2017-08-19
For iOS, MacRuby is unfortunately not an option, as it would require garbage collection. However, for writing OS X software, MacRuby works great (we just shipped an app with it in the App Store - http://briquetteapp.com - and it has definitely been a joy to work with).

Unfortunately, it doesn't really make the learning curve any less intense. While Objective-C's syntax and style are somewhat difficult, the real challenge to Mac/iOS programming is having a working knowledge of the Cocoa API. MacRuby simply acts as a bridge between Ruby and Cocoa, meaning you need to know exactly the same amount about API methods no matter the programming language you choose.

Reading the currently available MacRuby book is a great idea - http://ofps.oreilly.com/titles/9781449380373/. If you find yourself confused by the concepts, you should try learning Objective-C and Cocoa first (I learned with http://www.amazon.com/Cocoa-Programming-Mac-OS-3rd/dp/032150...). It is certainly possible to dive in with MacRuby! Just remember that it's not 1.0 yet, and could present technical difficulties in unexpected ways. Otherwise, it's super fun!

by joonas   2017-08-19
I've heard this is a really good introduction book, http://www.amazon.com/Objective-C-Programming-Ranch-Guide-Gu...

Having read their Cocoa programming for OS X book (http://www.amazon.com/Cocoa-Programming-Mac-3rd-Edition/dp/0...), I can wholeheartedly recommend their books.