views:

104

answers:

4

Experienced Objective-C/Cocoa Devs:

What are the key concepts that I should absorb early on that will get me closer to that epiphany moment where it all makes sense and I'm effectively creating solutions with Objective-C/Cocoa? I come from a .NET/Java background so everything I do is based on that paradigm.

I don't need deep specifics but rather the one or two things that you ran into that were different and took a while to soak in. A good example would be when I went from QuickBASIC to C 20+ years ago ... it took me forever to grasp the concept of a pointer. As a result I would say that a key concept of jumping from QuickBASIC to C is to understand memory addressing.

+1  A: 

There are a ton of concepts, which would be difficult to cover here. The Apple developer sites have a lot of great tutorials, guides, and API documentation surrounding writing applications, the Cocoa framework, and the conventions for writing apps. I would start there:

http://developer.apple.com/iphone/index.action

Andy White
I appreciate this Andy. I was hoping more core concepts. I will expand the question above.
Nissan Fan
+2  A: 

There are many differences, but a key one is the garbage collector. It's always there in .NET/Java, but optionally there in Cocoa. if you are not using the GC in Cocoa, then you really need to grok reference counting: retain, release, autorelease pools. This is a very rich source of bugs.

Matt Greer
I would say that even if you intend to use the garbage collector, you absolutely must learn reference counting. You will definitely need to use it at some point, and the lessons are valuable in the GC environment anyway.
Rob Keniger
+3  A: 

I would recommend Cocoa Design Patterns by Erik M. Buck and Donald A. Yacktman. Excellent book if you want to learn more about Cocoa's key concepts and their background and motivation.

My list:

  • How Cocoa uses the dynamic nature of Objective-C in the implementation of many everyday features like Undo, Bindings, ...
  • Interface Builder is not a code generator.
Ole Begemann
+1 design patterns are the bread and butter of understanding Cocoa.
Dave DeLong
+5  A: 

MEMORY MANAGEMENT. If you don't understand pointers, the difference between the stack and the heap, and how to accurately manage memory, you will spend years trying to grok Objective-C and Cocoa, but never "get it".

(I speak from experience; I [unfortunately] was taught to program in Basic-like languages, then spent 2 years trying to figure out what that #!@#^% asterisk meant. Then I took a Computer Engineering course, learned about memory, and then picked up Objective-C in a week)

Dave DeLong
I had a very similar experience. Pointers are a difficult concept if you don't learn them early on.
Rob Keniger