0

My crashlog is here.

This crash occurs on some of the testers. One tester with iPhone 6 (iOS 8.4.1) crashes but another tester with the same device (also iOS 8.4.1) doesn't crash. It also works on simulator.

I know this has been asked before but I think the problem is about ABPeoplePickerNavigationController. Or maybe this is a problem about Crashlytics.

What I wonder is: why do the same devices with the same operating system works differently? Also, I appreciate any solution to this problem?

Here is my code:

func peoplePickerNavigationController(peoplePicker: ABPeoplePickerNavigationController!, didSelectPerson person: ABRecord!, property: ABPropertyID, identifier: ABMultiValueIdentifier) {
    if property != kABPersonPhoneProperty {
        return
    }

    let phoneNumbers: ABMultiValueRef = ABRecordCopyValue(person, kABPersonPhoneProperty).takeRetainedValue()
    if (ABMultiValueGetCount(phoneNumbers) > 0) {
        let index = ABMultiValueGetIndexForIdentifier(phoneNumbers, identifier)
        let selectedPhoneNumber = ABMultiValueCopyValueAtIndex(phoneNumbers, index).takeRetainedValue() as! String

        let newNumber = "tel:\(phoneNumber)"
        println(newNumber)
        let url = NSURL(string: newNumber)

        if UIApplication.sharedApplication().canOpenURL(url!) {
            //test
            //UIApplication.sharedApplication().openURL(url!)
        } else {
            return
        }
    } else {
        return
    }
}
osrl
  • 8,168
  • 8
  • 36
  • 57
  • Have you found a solution ? – Sam Sep 01 '15 at 10:21
  • @Sam this is odd but exception was not about `ABPeoplePickerNavigationController `. There was an error about `NSURL`, fixed it, the crash was gone. – osrl Sep 02 '15 at 07:25

0 Answers0