Im getting the following error
Sending "NSString *_strong*to parameter of type _unsafe_unretained id* "changes retain/release properties of pointer
...
in the following line: [theDict getObjects:values andKeys:keys];
Im trying to add an address from contacts to my app. Could someone explain to me what its complaining about? I think its an ARC issue, possibly to do with manual memory management? but im unsure how to fix it.
- (BOOL)peoplePickerNavigationController:
(ABPeoplePickerNavigationController *)peoplePicker
shouldContinueAfterSelectingPerson:(ABRecordRef)person
property:(ABPropertyID)property
identifier:(ABMultiValueIdentifier)identifier
{
if (property == kABPersonAddressProperty) {
ABMultiValueRef multi = ABRecordCopyValue(person, property);
NSArray *theArray = (__bridge id)ABMultiValueCopyArrayOfAllValues(multi);
const NSUInteger theIndex = ABMultiValueGetIndexForIdentifier(multi, identifier);
NSDictionary *theDict = [theArray objectAtIndex:theIndex];
const NSUInteger theCount = [theDict count];
NSString *keys[theCount];
NSString *values[theCount];
[theDict getObjects:values andKeys:keys]; <<<<<<<<< error here
NSString *address;
address = [NSString stringWithFormat:@"%@, %@, %@",
[theDict objectForKey: (NSString *)kABPersonAddressStreetKey],
[theDict objectForKey: (NSString *)kABPersonAddressZIPKey],
[theDict objectForKey: (NSString *)kABPersonAddressCountryKey]];
_town.text = address;
[ self dismissModalViewControllerAnimated:YES ];
return YES;
}
return YES;
}