开发者

How to push UIViewController

I have UIViewController in Viewbased application. I want to push another UIViewcontroller from it.

-(IBAction) Myfunction
{

 MedicineSearchSystem *medicineSearchSystem = [[MedicineSearchSystem alloc]        initWithNibName:@"MedicineSearchSystem" bundle:nil];

 [self.parentViewController:medicineSearchSystem animated:YES]; // Crash here

}
开发者_运维技巧


As warrenm already told you, first check if your viewController has a navigationController by calling something like : NSLog(@"%@", self.navigationController) then you can push using:

[self.navigationController pushViewController:medicineSearchSystem animated:YES];

    self.mainItemListViewController = [[[NCItemsViewController alloc] init] autorelease];

self.navigationController = [[UINavigationController alloc] initWithRootViewController:self.mainItemListViewController];

[window addSubview:[self.navigationController view]];
[window makeKeyAndVisible];  
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜