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-01-2009, 03:40 PM   #1 (permalink)
AlanTaylor
Registered Member
 
Join Date: May 2009
Posts: 9
Default error pulling a city from Address Book

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

Last edited by AlanTaylor; 07-01-2009 at 04:44 PM. Reason: Ommission
AlanTaylor is offline   Reply With Quote
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Online Users: 329
14 members and 315 guests
AgCode, ansonl, beginer2007, bluelobster, ceggert, Eagle11, irishkiwi, Jeremy1026, kindelizaxi, mallmertl, mcgrath3, Rudy, slahteine, vargonian
Most users ever online was 779, 05-11-2009 at 09:55 AM.
» Stats
Members: 24,221
Threads: 39,001
Posts: 171,067
Top Poster: smasher (2,569)
Welcome to our newest member, kindelizaxi
Powered by vBadvanced CMPS v3.1.0

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