- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
UINavigationController *HomeNav = [[UINavigationController alloc] initWithRootViewController:[[HomeController alloc] init]];
[HomeNav.navigationBar setTintColor:[UIColor clearColor]];
CustomTabBar *tabBar = [[CustomTabBar alloc] init];
tabBar.buttonImages = [NSArray arrayWithObjects:@"t1.png" , nil];
tabBar.hightLightButtonImages = [NSArray arrayWithObjects:@"th1.png", nil];
tabBar.viewControllers = [NSArray arrayWithObjects:HomeNav , nil];
self.tabBarController = tabBar;
[tabBar release];
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
return YES;
}
in HomeController
view, there is one button
if tap the button I call `AViewController.
-(IBAction)tapButtonA:(id)sender;
{
[self.navigationController pushViewController:AViewController animated:YES];
}
there is also a button on the view of AViewController
.
if I tap the button, I call UIImagePickercontroller
-(IBAction)tapButtonB:(id)sender;
{
UIImagePickerController *picker=[[UIImagePickerController alloc]init];
picker.delegate=self;
picker.sourceType=UIImagePickerControllerSourceTypePhotoLibrary;
picker.allowsImageEditing = YES;
[self presentModalViewController: picker animated:NO];
}
If I tap the cancel button of the UIImagePickerController
-(void)imagePickerControllerDidCancel:(UIImagePickerController*)picker{
[self.presentingViewController dismissModalViewControllerAnimated:YES];
}
the UIImagePicker
will dismiss, but after 1,2 seconds the app crashes and displays
Welcome any comment