我收到以下错误
Sending "NSString *_strong*to parameter of type _unsafe_unretained id* "changes retain/release properties of pointer
...
在以下行中: [theDict getObjects:values andKeys:keys];
我正在尝试将联系人中的地址添加到我的应用程序中。有人可以向我解释它在抱怨什么吗?我认为这是一个 ARC 问题,可能与手动内存管理有关?但我不确定如何解决它。
- (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;
}