开发者

To Use NavigationViewController or NOT

开发者 https://www.devze.com 2023-03-23 14:34 出处:网络
I am creating an application which displays map using MKMapView control. I have a button on the map that takes me to different view (information view) using the following code:开发者_开发知识库

I am creating an application which displays map using MKMapView control. I have a button on the map that takes me to different view (information view) using the following code:开发者_开发知识库

 InfoViewController *infoViewController = [[InfoViewController alloc] initWithJogInfo:jogInfo]; 
    self.view = infoViewController.view;

Now after going to the information view I want to go back again to the main view which displays the map without having to loose anything. Is NagivationControlller my best option to use in this scenario?


Try this,

InfoViewController *infoViewController = [[InfoViewController alloc] initWithJogInfo:jogInfo];
[self.navigationController pushViewController:infoViewController animated:YES];
[infoViewController release];

once you push viewController back button is available to come back to rootViewController.

0

精彩评论

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