Can I push a modal view controller from within another modal view controller?
Posted
by Andy
on Stack Overflow
See other posts from Stack Overflow
or by Andy
Published on 2010-03-31T01:25:27Z
Indexed on
2010/03/31
1:33 UTC
Read the original article
Hit count: 494
I've got a rootViewController that, at one point, displays a peoplePickerNavigationController. I'm trying to push a second view controller when my user selects a specific contact property, like so:
-(BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)picker shouldContinueAfterSelectingPerson:(ABPersonRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier {
RuleBuilder *ruleBuilder = [[RuleBuilder alloc] initWithNibName:@"RuleBuilder" bundle:nil];
[self pushModalViewController:ruleBuilder animated:YES];
[ruleBuilder release];
return NO;
}
This compiles just fine, but when I run the code in the simulator and run through the peoplePicker, nothing happens when I select a contact property. On a whim, I added a [self dismissModalViewControllerAnimated:YES]; just before [ruleBuilder release]; and that dismisses the peoplePicker, but otherwise has no effect on my missing ruleBuilder.
Any ideas?
© Stack Overflow or respective owner