Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 07-02-2009, 03:17 AM   #7 (permalink)
Kalimba
Pro. Game Developer
iPhone Dev SDK Supporter
 
Join Date: Feb 2009
Location: ¿La Islas Hermosas?
Posts: 1,426
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?
__________________
piña para la niña interactive
Kalimba is online now   Reply With Quote
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Online Users: 285
22 members and 263 guests
Affan, Batman, beginer2007, calvin464, computermatt, dave1619, dre, Eagle11, FlukeDude, iGeorG, itzdark, Kalimba, LemonMeringue, masc2279, paul84, phaseIV, pstool, rdfrahm, ThirtyOne, Varras, williamlegate, wuf810
Most users ever online was 779, 05-11-2009 at 09:55 AM.
» Stats
Members: 24,214
Threads: 38,997
Posts: 171,053
Top Poster: smasher (2,569)
Welcome to our newest member, Varras
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 08:14 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.