Life as Clay

Archive for the ‘Book Review’ Category

Cocoa and Objective-C: Up and Running

leave a comment »

I spent the past 3 days reading and working through Cocoa and Objective-C: Up and Running, by Scott Stevenson. I own 5 or 6 “beginner” books about Cocoa and Objective-C. This is one of the better ones, with the condition that it is not for an absolute programming beginner.

Objective-C and Cocoa: Up and Running

There is a lot of theory at the beginning of the book. In fact, I believe it is not until chapter 8 that the first Cocoa / Interface Builder examples come into play. I was fatigued with theory by the time I reached that point, but was thankful for the background (especially the brief C primer) because most of the material is used in the Cocoa examples at some point.

There are a few spelling and code errors in the book, as is typical with programming books, but none of them were showstoppers. (There is one pesky error on p. 262… the line of code that reads @synthesize mainWindow; is not necessary and should be removed or the program will not compile.)

My primary disappointment with the presentation of the material is with the Gallery application in Chapter 9. This is the part where all of the concepts from chapters 1-8 come together. Instead of iteratively constructing the application so that it could be built successfully at checkpoints throughout the chapter, the application requires all of the code and interface builder elements in the chapter before it will compile. That’s a lot of code. It took me several hours to enter all of the code into Xcode. Sure, I know that the code is available online, but it helps me to understand it in context if I type it in while I’m reading it.

Wouldn’t you know, of course, that the application didn’t work when I finished the chapter. I sort of expected that, though, since I had to enter so much code before I could compile to check whether I was on the right track. I had a few small spelling errors that the compiler pointed out to me and I fixed. However, after the code successfully compiled, the application still didn’t work. The only indication of the problem was a cryptic line in the console. I suspected a code problem at first, so I reviewed all of it. The code was fine, so I turned to reviewing the .xib files associated with the application. By that point, I was tired and didn’t have the mental acuity to continue.

I sent an email to the author (via an address provided in the book) and he responded in a timely manner, instructing me to take a more careful look at the .xib files and offering to review my project for me. I appreciate that type of feedback. I thanked him but took to the .xib file and discovered where the error was. After a few minutes of hunting (thanks to the author for direction), I isolated the problem and the application ran.

The chapters that follow the Gallery application are of particular interest to me, about type and drawing. They were a little shallow in their presentation and left we wondering how to combine different graphics appropriately. I’ll have to look for another book to fill those gaps.

Overall, Cocoa and Objective-C: Up and Running is a good introduction to Mac programming for people with a little bit of previous programming experience. This is NOT a good book for an absolute beginner, but should work well for anybody with 4-6 months of experience with other languages under their belt. The book is loaded with material, making it a very good reference to have on hand, too.

Recommendation: Buy Now if you aren’t a total beginner. Buy Later if you need to learn basic concepts of programming first.

(For basics, I recommend Learning Processing, by Daniel Shiffman.)


Written by Clay

August 17, 2010 at 19:47