Нашли опечатку? Выделите ее мышкой и нажмите Ctrl+Enter
Название: iPhone SDK 3 Programming: Advanced Mobile Development for Apple iPhone and iPod touch (Wiley)
Автор: Maher Ali
I bought this book because I was struggling with some detail with navigation controllers. The book seemed to have the answer. Sadly the first example I looked at is flawed. In chapter 9, page 278 is the code line self.navigationItem.backBarButtonItem.title = @"Shows"; This is an attempt to give a title to a backBarButtonItem that does not exist at the root level of the navigation hierarchy. Page 276 shows a screenshot without the button or its impossible label, so the author should have picked up that the code was not working. Further into the nav hierarchy, the book (and downloaded source code from which I copied and pasted these code snippets), tries to name the backBarButtonItem again. e.g. self.navigationItem.backBarButtonItem.title = [delegate showNameAtIndex:delegate.selectedShow.row]; (p280 in the book). This does not work, despite its impressive sophistication. The back bar button title is derived from the title of the view from which we moved. (The screenshots on p276 and 277 show that this code line is ineffective and unnecessary, the navcontroller did all the work anyway. Again, the author should have realised that the code was not working, because it is obvious from the screenshots he supplied.) I have experimented with commenting out lines of his code and am satisfied that there is a conceptual error here. It would seem to be a major conceptual error, judging from the number of blogs, discussion groups etc on this very topic. After a couple of days struggling with this, I reviewed the Apple sample code again, and finally realised my conceptual error-shared, it would seem, with many others.