4 ms·
Ask YC: Best short text to learn Objective-C
My favorite C book is K&R.
My favorite Scheme books are The Little Schemer series.
My favorite JS book is JavaScript: The Good Parts.
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?
I'm interested in doing OSX/iPhone development, but looking to quickly get a strong theoretical understanding of the language before I dive in.
- makecheck 17y agoI'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-objc-en.pdf http://pierre.chachatelier.fr/programmation/fichiers/cpp-obj...
- scootklein 17y agohttp://www.amazon.com/Learn-Objective-ndash-Mac/dp/1430218150/ref=pd_sxp_grid_pt_0_2 http://www.amazon.com/Learn-Objective-ndash-Mac/dp/143021815... 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
- chasingsparks 17y agoApple 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/Conceptual/ObjectiveC/ObjC.pdf http://developer.apple.com/mac/library/documentation/cocoa/C...
- Zev 17y agoThere's also the (longer) Cocoa Fundamentals Guide that Apple has, http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaFundamentals.pdf http://developer.apple.com/mac/library/documentation/Cocoa/C.... 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 17y agoThere 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 17y agoI 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.
- recurser 17y agoThirded - after a quick run through this you'll grasp enough of the basics to figure anything else out from the apple docs on your own.
- grinich 17y agoHillegass' book has become the standard text for both learning and reference. If you're serious about Cocoa programming, you should grab a copy.
- andreyf 17y agoThis 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/Conceptual/ObjectiveC/Introduction/introObjectiveC.html http://developer.apple.com/mac/library/documentation/cocoa/C...
- amichail 17y agoObjective 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 17y agoMost 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 17y agoGreat tip on the analyzer. Here is a link to the project: http://clang-analyzer.llvm.org/ http://clang-analyzer.llvm.org/
- Zev 17y agoThe 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.
- eob 17y agoAgreed: memory management is easy if you stop thinking about it as reference counting and instead follow exactly what Zev just said. When I first got into ObjC I kept getting hung up on this idea of a "reference count" until someone on #iphonedev beat it into my head that all you need to do is release the things you declared ownership over.
- DenisM 17y agohow about retain cycles?
- 17y ago
- jfarmer 17y agoIf you know C or C++ I recommend Objective C for C++ Programmers: http://pierre.chachatelier.fr/programmation/fichiers/cpp-objc-en.pdf http://pierre.chachatelier.fr/programmation/fichiers/cpp-obj... 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 17y agoI'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.
- d0m 17y agoI 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.
- joeld42 17y agoThis guide was enough to get me started on the iPhone: http://www.otierney.net/objective-c.html 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..
- sunkencity 17y agoThe apple docs are pretty good once up to speed. Watch the first screencasts from http://www.stanford.edu/class/cs193p/cgi-bin/index.php 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.