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 > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08-04-2009, 02:15 AM   #1 (permalink)
New Member
 
Nitrex88's Avatar
 
Join Date: Apr 2008
Location: Long Island, NY
Age: 21
Posts: 84
Send a message via AIM to Nitrex88 Send a message via Skype™ to Nitrex88
Default Getting Zip Code from AddressBook

I'm having trouble getting individual values from the AddressBook framework when the user selects a person from their contact list. I am presenting the standard contact picker view and when they pick a person using this code...

Code:
ABMultiValueRef multi = ABRecordCopyValue(person, kABPersonAddressProperty);
for (CFIndex i = 0; i < ABMultiValueGetCount(multi); i++) {
      NSString *street = (NSString *)ABMultiValueCopyValueAtIndex(multi,i);
      NSLog(@"street = %@",street);
}
CFRelease(multi);
This is the output of the log when I do this

Code:
street = {
       City = Atlanta;
       Country = USA;
       CountryCode = ca;
       State = GA;
       Street = "3494 Kuhl Avenue";
       ZIP = 30303;
}
That's great but I need to grab individual elements alone such as zip code or the street so how would I go about that. Is their a way to do this or should I just for loop through the string till I reach "ZIP" and get a substring after the equal sign after that to get zip. Thanks!
Nitrex88 is offline   Reply With Quote
Old 08-04-2009, 02:37 AM   #2 (permalink)
New Member
 
Nitrex88's Avatar
 
Join Date: Apr 2008
Location: Long Island, NY
Age: 21
Posts: 84
Send a message via AIM to Nitrex88 Send a message via Skype™ to Nitrex88
Default

Nevermind I figured it out using this guide...

Jeff Kelley?s Blog Address Book

sorry i should have looked longer before posting.

Nick
Nitrex88 is offline   Reply With Quote
Reply

Bookmarks

Tags
address, addressbook, zip

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 316
19 members and 297 guests
@sandris, ADY, dacapo, Dani77, djohnson, dre, HDshot, HemiMG, JasonR, MarkC, mer10, nibeck, prchn4christ, ryandb2, spiderguy84, timle8n1, tomtom100, vogueestylee
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,882
Threads: 89,229
Posts: 380,763
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jansan
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:05 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0