1

My app allows the user to link other people within the app to entries in the contact book, and if one doesn't exist add a new one. I accomplish this by presenting an ABPeoplePickerNavigationController with an added button on the top for "Add Contact" which pushes an ABNewPersonViewController.

The problem I have is this functionality works perfectly in iOS 6, but completely fails to work properly in iOS 7. Clicking the "Done" button does absolutely nothing, and clicking "Cancel" simply stops the fields from being editable.

Has anyone encountered something like this and know how to fix it? Is this a known issue (Google search returned nothing useful"

Marco
  • 6,692
  • 2
  • 27
  • 38
Dan F
  • 17,654
  • 5
  • 72
  • 110
  • From the docs: "It is recommended that you present a new-person view controller modally." Does the problem persist if you wrap the `ABNewPersonViewController` in a plain `UINavigationController` and present it modally, instead of pushing it on the `ABPeoplePickerNavigationController`? – Aaron Brager Dec 30 '13 at 16:19
  • I haven't tried that, but the `ABPeoplePickerNavigationController` is presented modally. I think i had tried presenting it modally by itself before and ran into issues getting the people picker to dismiss and showing the new person controller at roughly the same time – Dan F Dec 30 '13 at 16:21
  • It sounds like a regression in iOS 7. If it's not fixed in the iOS 7.1 betas, I'd file a bug report. – Aaron Brager Dec 30 '13 at 16:23
  • Standalone `ABNewPersonViewController`s are functioning normally, only when pushed from a `UINavigationController` in iOS7+ don't – Dan F Dec 30 '13 at 20:46
  • Submitted bug report, closing question for the time being – Dan F Dec 31 '13 at 13:52
  • 1
    Bug appears to be an issue specifically with iOS 7. Minimized sample code reproduces the issue only apparent in iOS 7, and not iOS 6.1 – Dan F Dec 31 '13 at 13:53
  • What exactly do you expect to happen when you press done? Have you implemented the delegate methods? Have you set the `newPersonViewDelegate` property? Clicking on Done or Cancel will only notify the delegate that the action was performed. It is the responsibility of the presenter to dismiss. – Léo Natan Apr 10 '14 at 10:36

1 Answers1

0

Same problem for me. My code was as follows,

ABNewPersonViewController *npvc = [[ABNewPersonViewController alloc] init]; npvc.view.backgroundColor = [UIColor colorWithRed:0.188 green:0.545 blue:0.016 alpha:1.0];

After I removed “npvc.view.backgroundColor =…”, it works fine. Probably the structure of ABNewPersonViewController underneath has changed, so we are not allowed to set its background color.