Information Technology Reference
In-Depth Information
theZombie = [[NSObject alloc] init];
[theZombie release];
return YES;
}
- (void) timerDo {
NSLog (@”Tick”);
[theZombie release];
}
The code creates an instance of NSObject and releases it immediately. The timer handler includes a duplicate
release event. If you build and run this app without profiling it in Instruments, it crashes because the second re-
lease creates a zombie.
Figure 16.19 shows the result. You can see that the app crashed. But other than the EXC_BAD_ACCESS , which
can be caused by various issues, there's nothing to suggest why it crashed.
NOTE
If you have some experience with iOS, you may know that the absence of a stack trace or console report often
suggests a memory error. But there's nothing here to tell you where the error is located.
FIGURE 16.19
In this unhelpful crash report, Xcode doesn't give anything away about the cause of the crash.
Search WWH ::




Custom Search