Programming in Objective-C 2.0 provides the new programmer a complete, step-by-step introduction to Objective-C, the primary language used to develop applications for the iPhone, iPad, and Mac OS X platforms. The book does not assume previous experience with either C or object-oriented programming languages, and it includes many detailed, practical examples of how to put Objective-C to use in your everyday iPhone/iPad or Mac OS X programming tasks. A powerful yet simple object-oriented programming language that’s based on the C programming language, Objective-C is widely available not only on OS X and the iPhone/iPad platform but across many operating systems that support the gcc compiler, including Linux, Unix, and Windows systems. The second edition of this book thoroughly covers the latest version of the language, Objective-C 2.0. And it shows not only how to take advantage of the Foundation framework’s rich built-in library of classes but also how to use the iPhone SDK to develop programs designed for the iPhone/iPad platform. Table of Contents 1 Introduction Part The Objective-C 2.0 Language 2 Programming in Objective-C 3 Classes, Objects, and Methods 4 Data Types and Expressions 5 Program Looping 6 Making Decisions 7 More on Classes 8 Inheritance 9 Polymorphism, Dynamic Typing, and Dynamic Binding 10 More on Variables and Data Types 11 Categories and Protocols 12 The Preprocessor 13 Underlying C Language Features Part The Foundation Framework 14 Introduction to the Foundation Framework 15 Numbers, Strings, and Collections 16 Working with Files 17 Memory Management 18 Copying Objects 19 Archiving Part Cocoa and the iPhone SDK 20 Introduction to Cocoa 21 Writing iPhone Applications Part Appendixes A Glossary B Objective-C 2.0 Language Summary C Address Book Source Code D Resources
I've recently dived head-first into the Mac/Objective-C/Cocoa world. I have scads of related titles sitting around my home and office. I've been waiting awhile for this book to come out as I was looking for a good up-to-date reference on the Objective-C language.
As an overview of important concepts and a desktop reference this book didn't disappoint. I basically skimmed the book in about three days and filled a good amount of gaps in my Obj-C knowledge.
One downside to a perspective reader is the nearly-useless iPhone chapters that were added to the end of the book. They are two small to provide much information and seem to merely add weight to an already-quite-thick book. Otherwise, it's a great reference.
Dr. Kochan's text is not bad. It certainly provides sufficient background to introduce the reader to programming in Objective-C. I enjoy the paragraph prose occasionally interwoven with usage examples. The iOS fraction calculator is also an exciting final exercise.
However, the book has several notable shortcomings that deter readers interested in jumping into programming:
1.) The ordering is odd. Background C programming is presented in chapter 13, in the middle of the text. Even though Kochan justifies its marginality by pointing out that Objective-C is object-oriented and therefore best learned with a fresh mind and non-procedural habits, it still comes before most of the object-oriented Foundation content, specifically strings, numbers, collections. If C really is knowledge that should come after usage habits have been developed, it would better be placed at the end, rather than in the middle.
2.) UNIX references are distracting. My background is in C/C++, so I can understand how UNIX programmers might benefit from analogies, but these references rarely add anything to the material. They are too numerous and distracting. Particularly in the file system chapter, even with a programming background, I had no idea what any of his UNIX references meant, or why they might be useful to know. Furthermore, the author links them to developing command line tools, completely off the beaten path. Why would UNIX programmers be reading an introductory programming book in the first place? These analogies have no place in a book like this, and only further the esoteric feel of programming in an already-difficult area such as file systems.
3.) The code samples stretch on too long without explanation. I understand the need to present code files in complete form, but they need better explanation in between. Reading five pages of code without any explanation is tiring and boring, and even for programmers, quickly makes me want to quit or skip. Explanations sometimes come later, forcing flipbacks to the code section. Breaking up the code with explanations would have been much more readable.
4.) The code samples often do not run. One of the major reasons code is beneficial to read is seeing actual working examples in action. However, outside of the final iOS sections, there are not any self-contained, working Xcode projects or sets of code. ViewController isn't even mentioned until the final 40 pages on iOS. Most of the examples, while syntactically correct, work on mock images and files that make no sense without more context. For example, in the section on file handles, the examples are all @"testfile" or @"path" or @"testoutput" without real extensions. This is very confusing for a reader simply interested in trying out the code on text files, or a local directory, because these files have no extensions, and the book never explains what a real file name might be, in action. The book also comes with no accompaniment files on a website or CD where users can actually run the code to test on real files. The author does not provide adequate real-world examples that might clear the confusion of meaningless place holders like @"imageA" (JPG? PNG? TIF?) or @"newfile" (directory? executable?). These are crucial strings to get right because the slightest missing slash or extension results in a dysfunctional program. Beginners generally have no such intuition, and the author provides no guidance.
5.) Too much deference to Apple documentation. While I understand not pasting in every single Apple doc to save space, Kochan too often leaves readers trailing without as much as a table or a listing of the functions that the documentation is better served to elucidate. Instead, he simply tells the reader to look at the documentation for more. However, beginning programmers generally do not have the motivation to "look at documentation." Where in the documentation? Even a link, a page number, a section title or number, some paths or terms, or even just a screenshot, would be better than the lazy "look at Apple's documentation to learn more." Kochan too often ends a section with "But there are many more functions to the NS.... check your documentation for details." Sorry, your readers are not expert programmers. If we were satisfied looking for, searching, and reading documentation, we would not be purchasing a book.
6.) Not enough iOS-ready examples. Most readers are probably reading the book not just to learn syntax, but to apply Objective-C to programming software, so having only one full-fledged iOS program is unforgivable. The only end-to-end program that Kochan walks his readers through is a fraction calculator for iPhone. While that program is quite exciting, it is not sufficient for an entire book. Even miniature programs would be welcome because they can provide incentive to test out and reaffirm knowledge that Kochan teaches. However, the code snippets throughout the book are both long and not fully functional programs.
In summary, Dr. Kochan's introduction to Objective-C is a good educational source, in a vacuum, but because many readers are likely looking to apply the knowledge as they learn it, providing more examples and functional programs is a must. I was disappointed that after completing the fractional calculator, I had no other walkthrough examples to program.
This is excellent book for every beginner in Objective-C. I had previous experience with object oriented programming but I had no experience with C or Objective-C, I started to develop applications before reading any books. After I read this book I started to develop more quickly and more optimized code, it helped me to eliminate memory leaks in my applications. I learned the basics and most common practices in Objective-C. All in all great and essential book for every starter in Objective-C.
This is a really nice overview of Objective-C programming, and I also appreciated the format. Having learned C, C++, C# and also Java in my time, I find far too many texts begin with procedural programming, and then tackle object-oriented programming (especially books on languages like C++, which draw from C).
I bought this book because I am a beginner to Objective-C, and want to learn iPhone programming. The book could have done a bit more to explain the graphics frameworks available--there were a few thin chapters on the iPhone at the end of the text. I'm OK with it not being an iPhone guide, but a bit of graphics programming would be helpful.
If there was a book that actually taught some foundational best practices in working with graphics frameworks, these books would produce more functional programmers. Don't leave it to the API guide... we need more than just a list of API calls.
I did enjoy this book, and with the above caveats would recommend it to anyone starting out in Objective-C.
I expected the book to be out of date (it was), but I also expected to get a good grounding in the basics of Objective-C (plus, it's the only one I could get from my library).
I think this book suffers from trying to be a little bit of everything to everyone.
It's written in a manner that could almost be called 'intro to programming', but yet fails to adequately describe many critical features of object oriented programming and the foundation of C (don't get me started on the section for polymorphism! let's just say, if you haven't done much programming, please don't use this book as your 'intro to programming' book).
And on to the subject of learning Objective-C.....well, I did pick up some details I didn't really know before, but found most of the discussion to be too superficial to give me a good in-depth knowledge about what I wanted to learn - I kept coming across topics and thinking 'hmmm... I need to find a book or site that explains that better'.
I'm a lover of books, so I'll continue my search for a good one, but for now I'm recommending online resources.
This was somewhat disappointing. It was too basic to be of much use to me and where it could have been of use, it tried to stay so general that it never quite managed.
I think beginners might be better suited to a book that doesn't try to pretend that Objective C is used anywhere but OS X or iOS like this one tries. And intermediate and advanced users can look elsewhere.
The edition I read was also somewhat out of date and appears to predate Snow Leopard and iOS 5 with the relatively major changes that came there.
A very well written book for all audiences. I would highly recommend this book for anyone who isn't already familiar with the C programming language. In fact a very large portion of the book is spent going over the basics, but like most OO developers I haven't written a C program in a decade so going back over the basics was beneficial. The chapter on memory management could have been explained better, fortunately the iphone developer's website does a great job covering this topic.
The section on the language core is well described through object oriented principles, although the rest of the book is lacking in relevance. And why still, when absolutely no one needs to write math classes and functions anymore, must all the examples be of this nature. It may be consistent but it's not at all useful.
Read it for Part 1, get other book to learn how to use the frameworks and iOS.
Very thorough, although I think the language could be a bit daunting to some. If you're intelligent and you're not afraid of getting used to a few "big" terms, this is the book for you. I love that he assumes you're an educated, thinking individual if you've picked up this book, and doesn't treat you like a moron. This is not a "For Dummies" type of book, but it is very, very concise and can teach you the basics of Objective-C in one fell swoop.
if your goal is to create an iPhone app and you're already familiar with C, skimming this book should be sufficient to familiarize yourself with Objective C syntax. the chapter on iPhone development just gives you a taste, I recommend you get a dedicated text assuming you're still on the bandwagon!
Currently busy working through this book. Not sequentially following it, since I've been in IT for over twenty years, but finding how things are done in the MAC OS environment with Object C and Cocoa.
Really nice book for beginners in the Objective-C language. I've made my first steps in the development for Mac OS X and iOS with this book. My mark is 4, because I alredy have had some experience with other programming languages and some chapters for me was really boring :)
I found the book a good read and learned about objective c. I find it hard to go back too as a reference when I have a question. The index appears to be very poor or incomplete so I spend time searching for things I remember reading about sometime earlier.
Первая часть, 66% книги, это обычное описание языка с нуля. Как будто есть ещё люди, которые не знают ни одного языка программирования. О, что же такое иф? С ума сойти, цикл FOR! Вот чудеса-то! Некоторое внимание уделено архитектуре эппловских устройств. Во второй части интересный пассаж про MRC/ARC, это полезно. Третья часть вся посвящена написанию одной тестовой программы. То же можно прочитать в любой хаутушке в сотнях блогов. Но в единой книге довольно удобно для восприятия, живенько и понятно написано. Хорошая книга.