Return to Snippet

Revision: 42443
at March 5, 2011 07:18 by streamt


Initial Code
-(IBAction)buttonClick:(id)sender
{
	
	PurchaseWindowViewController* viewController = [[PurchaseWindowViewController alloc] initWithNibName:@"PurchaseWindowViewController" bundle:nil];
	
	UINavigationController *navController = [[UINavigationController alloc]
											 initWithRootViewController:viewController];
	
	
	navController.modalPresentationStyle = UIModalPresentationFormSheet;
	navController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
	
	viewController.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Cancel", @"") style:UIBarButtonItemStyleBordered target:self action:@selector(close)];
	
	[self presentModalViewController:navController animated:YES];
	
	//targetController.view.superview.frame = CGRectMake(0, 0, 200, 200);//it's important to do this after presentModalViewController
	//targetController.view.superview.center = self.view.center;

	// Clean up resources
	[navController release];
	[viewController release];
	
}


- (void)close
{
	[self dismissModalViewControllerAnimated:YES];
}

Initial URL

                                

Initial Description

                                

Initial Title
Show Modal Dialog

Initial Tags
c

Initial Language
Objective C