我有一个rootViewController,它一度显示一个peoplePickerNavigationController。当我的用户选择特定的联系人属性时,我正在尝试推送第二个视图控制器,如下所示:
-(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;
}
这个编译得很好,但是当我在模拟器中运行代码并运行peoplePicker时,当我选择一个联系人属性时没有任何反应。一时兴起,我添加了一个[self dismissModalViewControllerAnimated:YES];就在[ruleBuilder发布]之前;并解散了peoplePicker,但对我缺少的ruleBuilder没有任何影响。
有什么想法吗?
答案 0 :(得分:0)
找到解决方案:
[picker pushModalViewController:ruleBuilder animated:YES];