Can I push a modal view controller from within another modal view controller?

荒凉一梦 提交于 2019-12-24 06:20:51

问题


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?


回答1:


Found the solution:

[picker pushModalViewController:ruleBuilder animated:YES];


来源:https://stackoverflow.com/questions/2549847/can-i-push-a-modal-view-controller-from-within-another-modal-view-controller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!