Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

arnieterm

macrumors regular
Original poster
Aug 28, 2008
201
0
I have created a very simple project that has two viewcontrollers
WelcomeViewController and AddInfoViewController
In the applicationDidFinsihLaunch method

Code:
WelcomeScreenViewController* welcome = [ [WelcomeScreenViewController alloc] initWithNibName:@"WelcomeScreen" bundle:nil];
		[window addSubview: welcome.view];
There is a button on Welcome screen on whose click, I show another view controller
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];		
}
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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.