Hello guys,
I have a main UIViewController that is create at startup that I only use to switch between 2 different view controllers that are presented modaly.
Here my code that does the switch:
- (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*)info {
[self dismissModalViewControllerAnimated:NO];
PreviewView *previewViewController = [[PreviewViewController alloc] initWithNibName:@"PreviewView" bundle:nil];
previewViewController.delegate = self;
[self presentModalViewController:previewViewController animated:YES];
[previewViewController release];
}
- (void)previewViewControllerdoneButtonPressed:(AnotherViewController*)controller {
[self dismissModalViewControllerAnimated:YES];
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
[self presentModalViewController:imagePicker animated:NO];
[imagePicker release];
}
In the first method, the switch works but not in the second. I will like to understand why.
Thanks!