Reputation: 767
Im using this code to show an ABUnknowPersonViewController for showing a record from a person which was created from a vCard String:
- (ABRecordRef)person {
if (person == NULL) {
ABPersonCreator *creator = [[ABPersonCreator alloc] initWithVcardString:vcardString];
person = creator.person;
CFRetain(person);
[creator release];
}
return person;
}
- (UIView *)fullscreenView {
unknownPersonController = [[ABUnknownPersonViewController alloc] init];
unknownPersonController.displayedPerson = self.person;
unknownPersonController.allowsAddingToAddressBook = YES;
unknownPersonController.allowsActions = YES;
unknownPersonController.unknownPersonViewDelegate = self;
return unknownPersonController.view;
}
Can someone help me out with this?
thx Philip
Upvotes: 2
Views: 342
Reputation: 4166
The solution to this problem for me was that I wasn't passing the right stuff when building the ABRecordRef. For instance, I tried to simply set a string to a property when it instead wanted a kABMultiStringPropertyType. The exception would only occur after trying to launch the UnknownPersonViewController.
Check your datatypes and make sure that you're building the right thing.
Upvotes: 1
Reputation: 2433
Shouldn't have unknownPersonViewController have an autorelease, as it's view's returned?
Upvotes: 0