から画像を選択した後、ビュー コントローラーを呼び出す必要があるimagePickerController
ため、次のコードを使用しました。
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
imageEditorView = [[ImageEditorViewController alloc]initWithNibName:@"ImageEditorViewController" bundle:nil];
imageEditorView.mainViewController = self;
imageEditorView.imageBG = [info objectForKey:UIImagePickerControllerOriginalImage];
[self presentViewController:imageEditorView animated:YES completion:nil];
}
しかし、デバッガーは私にこの警告を出します:
Warning: Attempt to present <ImageEditorViewController: 0xaa42320> on
<ViewController: 0x9b58680> whose view is not in the window hierarchy!
そして何もありません!
そして、私がそれをdissMissすると、最初のデバッガーは私にこのエラーを与えます:
Warning: Attempt to present <ImageEditorViewController: 0xa913980> on
<ViewController: 0x9b332a0> while a presentation is in progress
!
編集済み
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil] autorelease];
} else {
self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil] autorelease];
}
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}