- (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。的UIImagePickerController导致崩溃的iOS5上
-(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秒的应用程序崩溃后并显示
欢迎任何评论
尝试剖析应用程序:' + I' - >'Zombies',看看是不是这样的问题。 –
tipycalFlow
2012-03-28 06:47:04
检查此链接:http://stackoverflow.com/questions/8454820/ios-5-uiimagepickercontroller-crash – Devang 2012-03-28 06:51:39
你应该删除你的图像,因为它不提供信息 – Gargo 2012-03-28 06:58:58