1

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?

Andy
  • 576
  • 1
  • 9
  • 23

1 Answers1

0

Found the solution:

[picker pushModalViewController:ruleBuilder animated:YES];
Andy
  • 576
  • 1
  • 9
  • 23
  • 1
    Thanks for the info. Unfortunately, this doesn't work if the screen you're on doesn't have a navigation controller. PresentModalViewController doesn't do it; it only shows one. – Oscar Jan 14 '11 at 12:18
  • Oscar is right so this should not be considered the right answer until it is updated. – twerdster Nov 18 '11 at 18:09
  • If the screen you are on doesn't have a nav controller, create one with **ruleBuilder** as its root controller. Then present the NavConttroller. – surfasb Nov 26 '11 at 02:03