开发者

where to control view controllers?

开发者 https://www.devze.com 2023-02-11 19:51 出处:网络
i\'m working in view-based template, and I have main.m, which I haven\'t touched. and one view controller which is my current display,

i'm working in view-based template, and I have main.m, which I haven't touched. and one view controller which is my current display, and one dummy controller which has nothing.

If I implement the dummy controller, and want to switch between two view controllers, where and how should I do it? I've only worked with subviews, but not qu开发者_StackOverflow中文版ite sure where to touch the view controllers... does it work the same as addView, release as with subviews? Please help me out..


It depends on how you want you're looking to do. You could present your dummy view controller either modally or non-modally. To do it modally, check out:

- (void)presentModalViewController:(UIViewController *)modalViewController animated:(BOOL)animated

Here is a sample on how you would do something like that:

DummyViewController *dummyController = [[DummyViewController alloc] init];
[self presentModalViewController: dummyController];

You could also do something like:

- (void)presentFlipSideViewController:(UIViewController *)flipsideViewController

You would call these methods when the user did something, such as tap a button. Both of these methods would be implemented in the view controller handling the tap or action, in your case, the project template view controller .

0

精彩评论

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