Hi, I have some code that pulls the addresses from the AddressBook, and if there is one, it then gets the city. I only care about the city!
It is currently giving a warning that I can't seem to get to go away. The code *seems* to work fine on the simulator but does not work at all on the iPhone.
This is the code I am using:
Code:
ABMutableMultiValueRef addressMulti = ABRecordCopyValue(person, kABPersonAddressProperty);
NSMutableArray *address = [[NSMutableArray alloc] init];
int i;
for (i = 0; i < ABMultiValueGetCount(addressMulti); i++) {
NSString *city = [(NSString*)ABMultiValueCopyValueAtIndex(addressMulti, i) autorelease];
[address addObject:city];
}
if ([address count] > 0) {
NSMutableDictionary *primaryAddress = [address objectAtIndex:0];
meCity1 = [primaryAddress objectForKey:kABPersonAddressCityKey];
************ WARNING: passing argument 1 of 'objectForKey:' from incompatible pointer type **********
NSLog(@"%@", meCity1);
}
meCity1 is set up earlier in the program
Any help with this would be greatly appreciated