
Ask YC: Best short text to learn Objective-C - andreyf
My favorite C book is K&#38;R.
My favorite Scheme books are The Little Schemer series.
My favorite JS book is JavaScript: The Good Parts.<p>The pattern is that they're all ~100 pages long, and assume I'm not dumb. What's an Objective-C book I'd like?<p>I'm interested in doing OSX/iPhone development, but looking to quickly get a strong theoretical understanding of the language before I dive in.
======
chasingsparks
Apple actually has a wealth of high-quality, Objective-C PDF's online for
free.

Intro to Objective-C:
[http://developer.apple.com/mac/library/documentation/cocoa/C...](http://developer.apple.com/mac/library/documentation/cocoa/Conceptual/ObjectiveC/ObjC.pdf)

~~~
Zev
There's also the (longer) Cocoa Fundamentals Guide that Apple has,
[http://developer.apple.com/mac/library/documentation/Cocoa/C...](http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaFundamentals.pdf).

Instead of focusing on the language, it goes over the basic frameworks you'll
use, the design patterns that the frameworks use, delegation, target-action,
bindings, and so on. Pretty much the basics of everything that you'd possibly
need to know to make an app, either on the iPhone or OS X.

------
cmelbye
There really isn't much to Objective-C. If you're learning Objective-C to do
Mac development, I'd highly recommend Cocoa Programming for Mac OS X by Aaron
Hillegass. It spends about 40-50 pages talking about Xcode and Objective-C,
and it goes in depth for a lot of key Cocoa concepts in the rest of the book.

~~~
bmalicoat
I second the Hillegass suggestion. Not only is it considered one of the best,
you really don't need to read too much of it before you can be off and running
on your own.

------
makecheck
I'm not sure about entire books, but here is a PDF that sums it up pretty well
for those with C++ background:

[http://pierre.chachatelier.fr/programmation/fichiers/cpp-
obj...](http://pierre.chachatelier.fr/programmation/fichiers/cpp-objc-en.pdf)

------
amichail
Objective C is mostly quite straightforward; the only tricky bit is memory
management. (There is no garbage collection on the iPhone.) This is assuming
you are familiar with OO programming.

~~~
Zev
Most of the time, memory management with objc is easy; if you alloc, retain,
copy or mutableCopy, you need to release (or autorelease). Combine that with
Clang's Static Analyzer to give a warning on a leak, and you shouldn't have
any problems with memory.

~~~
weaksauce
Great tip on the analyzer. Here is a link to the project: <http://clang-
analyzer.llvm.org/>

~~~
Zev
The analyzer comes built into Xcode 3.2 on 10.6; no need to install another
version (unless you're still on 10.5, I suppose — but you should update to
10.6 in that case, if only for the new dev tools).

Either hit cmd + shift + a to run the analyzer or check the box in the project
info to automatically run it before every build.

------
scootklein
[http://www.amazon.com/Learn-Objective-ndash-
Mac/dp/143021815...](http://www.amazon.com/Learn-Objective-ndash-
Mac/dp/1430218150/ref=pd_sxp_grid_pt_0_2)

it's a very quick read (sorry for the Mac bias) and allowed me to get through
it in about a day before moving on to the iPhone app book from the same series

------
joeld42
This guide was enough to get me started on the iPhone:
<http://www.otierney.net/objective-c.html> I've got a lot of C/C++ experience,
but this was my first look at O-C.

The only thing it didn't cover that I needed is @properties, which is easy
enough to google for.

Combined with the excellent iPhone SDK examples and documentation, I'm pretty
close to finishing my first non-trivial iPhone app (well, kind of trivial).

I'll check out some of these other links, too..

------
jfarmer
If you know C or C++ I recommend Objective C for C++ Programmers:
[http://pierre.chachatelier.fr/programmation/fichiers/cpp-
obj...](http://pierre.chachatelier.fr/programmation/fichiers/cpp-objc-en.pdf)

It maps out all the Objective-C-specific parts of Objective-C and tells you
how they correspond to OO conventions in other languages (usually C++ or
Java).

Very useful, especially if you find Objective-C's syntax the roadblock but
have a good understanding of OO in general.

~~~
squidbot
I'll second that. I was clicking to recommend it in fact. This is the best
document I've found on learning Objective-C as a C++ programmer.

------
andreyf
This seems useful: _This document both introduces the object-oriented model
that Objective-C is based upon and fully documents the language. It
concentrates on the Objective-C extensions to C, not on the C language
itself._

[http://developer.apple.com/mac/library/documentation/cocoa/C...](http://developer.apple.com/mac/library/documentation/cocoa/Conceptual/ObjectiveC/Introduction/introObjectiveC.html)

------
sunkencity
The apple docs are pretty good once up to speed. Watch the first screencasts
from <http://www.stanford.edu/class/cs193p/cgi-bin/index.php> if you like the
academic lesson format, that introductory one goes through most of the gotchas
with objective-c.

------
d0m
I agree with you about K&R and The Good Parts.. however, after reading those
little schemer book, I felt like 1 book = 1 page of sicp and I really felt
like the author took my for an idiot.

And, again imho, you should just first dive in, then search for answers.

