- Full Description
Its time to capitalize on your mastery of Cocoa with Pro Objective-C Design Patterns for iOS. Youve developed apps that impressed and performed, and now youre ready to jump into development practices that will leave you with more effective, efficient, and professional level apps. This book is the element you need to make the jump from journeyman to master.
All too often, developers grind through building good apps on willpower and a vigorous focus on code development, leaving them unaware of and unable to benefit from the underlying structural and functional design patterns.
Pro Objective-C Design Patterns for iOS will teach you those design patterns that have always been present at some level in your code, but were never recognized, acknowledged, or fully utilized. Implementation of specific pattern approaches will prove their value to any developer working in the iOS application arena. Youll learn to master classic patterns like singleton, abstract factory, chain of responsibility, and observer. Youll also discover less well-known but useful patterns like memento, composite, command, and mediator.
What youll learn
- The basic concepts of various design patterns
- How to apply design patterns to your code based on different scenarios
- How design patterns can strengthen your apps
Who this book is for
Any professional or aspiring iOS developer will find productivity, efficiency, and effectiveness of software development enhanced by the methods and practice delivered by Pro Objective-C Design Patterns for iOS.
- Table of Contents
Table of Contents
- Hello, Design Patterns!
- A Case Study: Designing an App
- Factory Method
- Abstract Factory
- Chain of Responsibility
- Template Method
- Source Code/Downloads
If you think that you've found an error in this book, please let us know by emailing to firstname.lastname@example.org . You will find any confirmed erratum below, so you can check if your concern has already been addressed.On page 60:
In the code that follows "// copy the children", child is added to strokeCopy instead of childCopy. Don't you want to add the copy of child, not child itself?
In the third paragraph of text, it states "Vertex is a direct subclass of Dot." Isn't it the other way around?
On page 216:Listing 14-8 for file Mark.h includes definition for method enumerateMarksUsingBlock:. Listing 14-9 is described as containing the implementation for enumerateMarksUsingBlock, but lists the source file as Stroke.m. I think it should be Mark.m.
On page 239 (Kindle):That is 239ish of 500 in the Kindle version. No idea what the actual page number is.
This is actually addressing a leak in the code. When you launch a scribble from the thumbnail you get.
2011-07-25 00:58:03.048 TouchPainter[39826:207] An instance 0x5a0bfb0 of class Scribble was deallocated while key value observers were still registered with it. Observation info was leaked, and may even become mistakenly attached to some other object. Set a breakpoint on NSKVODeallocateBreak to stop here in the debugger. Here's the current observation info:
<NSKeyValueObservationInfo 0x5a3cad0> (
<NSKeyValueObservance 0x5a3c9d0: Observer: 0x5d168c0, Key path: mark, Options: <New: YES, Old: NO, Prior: NO> Context: 0x0, Property: 0x5a033f0>
I think this problem can fix fixed by adding [scribble_ removeObserver:self forKeyPath:@"mark"]; in the setScribble method in CanvasViewController.
- (void) setScribble:(Scribble *)aScribble
if (scribble_ != aScribble)
[scribble_ removeObserver:self forKeyPath:@"mark"];
scribble_ = [aScribble retain];
// add itself to the scribble as
// an observer for any changes to
// its internal state - mark