I have created a very simple project that has two viewcontrollers
WelcomeViewController and AddInfoViewController
In the applicationDidFinsihLaunch method
There is a button on Welcome screen on whose click, I show another view controller
as shown:
Then the addinfo has a button to show the UIImagePickerController for selecting an image from photo album
I am also able to get the event when the user select "Choose" for an image
My problem is that when the UIImagePickerController goes away from screen it also takes away the addinfo viewcontroller and I am only seeing the welcomeviewcontroller
What is wrong with my approach?
Any idea??
Thanks
Arnieterm
WelcomeViewController and AddInfoViewController
In the applicationDidFinsihLaunch method
Code:
WelcomeScreenViewController* welcome = [ [WelcomeScreenViewController alloc] initWithNibName:@"WelcomeScreen" bundle:nil];
[window addSubview: welcome.view];
as shown:
Code:
AddInfoViewController* addinfo = [ [AddInfoViewController alloc] initWithNibName: @"AddInfo" bundle:nil ];
CGRect f = self.view.frame;
f.origin.y = 0;
addinfo.view.frame = f;
//[navController pushViewController:addchild animated:YES];
[self.view insertSubview:addinfo.view aboveSubview:self.view];
Then the addinfo has a button to show the UIImagePickerController for selecting an image from photo album
I am also able to get the event when the user select "Choose" for an image
Code:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo
{
selectPhoto.view.hidden = YES;
[selectPhoto dismissModalViewControllerAnimated:YES];
}
What is wrong with my approach?
Any idea??
Thanks
Arnieterm