haibarahu
haibarahu

Reputation: 49

switch UIViewController In iOS

I have three UIViewController :A, B, C

I goto B from A

I goto C from B

how can I goBackTo A from C Without through B?

//in a.m
B* b =[B alloc] init];
[self presentModalViewController:b animated:YES];
[b release];
//in b.m
C* c=[C alloc] init];
[self presentModalViewController:c animated YES];
[c release];

Upvotes: 0

Views: 236

Answers (1)

I am actually not sure whether this works without a navigation controller. If not, you can dismiss b and c using a delay.

[self popToRootViewControllerAnimated:YES];

EDIT:

As stated below, that won't work. Use [self dismissmodalviewcontroller:animated:] inside of a delay to do what you want.

Upvotes: 1

Related Questions