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-01-2009, 04:40 PM   #1 (permalink)
AlanTaylor
Registered Member
 
Join Date: May 2009
Posts: 13
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 05:44 PM. Reason: Ommission
AlanTaylor is offline   Reply With Quote
 

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

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