Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 07-02-2009, 04:17 AM   #7 (permalink)
Kalimba
Pro. Game Developer
iPhone Dev SDK Supporter
 
Join Date: Feb 2009
Location: żLa Islas Hermosas?
Posts: 2,178
Default

Quote:
Originally Posted by AlanTaylor View Post
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
The compiler is being very specific in its warning. It doesn't like the argument being passed as the first parameter. So.... how is 'kABPersonAddressCityKey' defined?
__________________
~~ Word Flurry ~~ App Store / Website / Facebook
Kalimba is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,664
Threads: 89,154
Posts: 380,376
Top Poster: BrianSlick (7,110)
Welcome to our newest member, SolerA1
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:03 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.