- (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;
}
в представлении HomeController
, есть одна кнопка, если нажать кнопку, которую я называю `AViewController.
-(IBAction)tapButtonA:(id)sender;
{
[self.navigationController pushViewController:AViewController animated:YES];
}
, есть также кнопка в представлении AViewController
.
если я нажму кнопку, я позвоню UIImagePickercontroller
-(IBAction)tapButtonB:(id)sender;
{
UIImagePickerController *picker=[[UIImagePickerController alloc]init];
picker.delegate=self;
picker.sourceType=UIImagePickerControllerSourceTypePhotoLibrary;
picker.allowsImageEditing = YES;
[self presentModalViewController: picker animated:NO];
}
Если я нажму кнопку отмены UIImagePickerController
-(void)imagePickerControllerDidCancel:(UIImagePickerController*)picker{
[self.presentingViewController dismissModalViewControllerAnimated:YES];
}
, UIImagePicker
будет отклонен,но через 1,2 секунды приложение вылетает и отображает
![enter image description here](https://i.stack.imgur.com/SKkxq.png)
Приветствую любой комментарий