I had done all the projects on 3.2. Things respond differently in 4.2 when quitting.
Quitting an application responds differently now that background tasks are supported. The application doesn't actually quit, until something else needs the resources (memory). The last state of the application persists. If you want the initial screen to come up you can insert the following into the â¦AppDelegate method
Code:
- (void)applicationWillResignActive:(UIApplication *)application {
NSArray *subViews = [[[window subviews] objectAtIndex:0] subviews];
if ([subViews count] == 3) {
[[subViews objectAtIndex:2] removeFromSuperview];
}
}
the method
- (void)applicationWillTerminate:(UIApplication *)application
and
-(void)dealloc
appear to only be called when the system quits the program.
Further info is available here or in your documentation
http://developer.apple.com/library/i...Reference.html
This works for the program as written in the book. In something more complex you would tag your views.
Keep in mind this behavior is not necessarily what you will want. For example, if your program is interrupted by another task, e.g. new mail and you switch to the Mail program, you most likely would want to return to the screen in the state you left it, not the program start screen.
Hope this helps. Let me know if there are any questions.
Bob