Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ataylor2009

macrumors member
Original poster
Jan 27, 2009
78
0
I am trying to build what I believe is a fairly basic app. I need to be able to, from my main view, use the people picker to navigate through the contacts database, then return a specific piece of a specific contact's information. I believe I need to know 2 things (2 instance variables): which contact was selected, and which property was selected (i.e., work phone, home email, etc.) But I'm putting the cart before the horse here.

I've created a pretty view in IB, and I can build and run the app on the simulator no problem. It doesn't do anything yet, but it looks nice. So, I'm back in Xcode trying to whip up some code that tells my app to open the people picker when the "Add" button is pressed on my view. I tried the code from Erica Sadun's iPhone Developer's Cookbook, page 274, but I start getting errors about undeclared protocols. I have looked in several of my reference books, but cannot seem to find a decent, complete explanation of how to "adopt" a protocol. EDIT: Sources checked include Hillegas, Cochan, Sadun, Apress' "Beginning iPhone Development," and my trusty PDF-only version of "Cocoa Programming for OS X." All of these touch (har har) on protocols, but none of them say, "Put this line of code in this place in this file, and this line of code in this place in this file," which is what I think I need.

So, if I start up Xcode, choose "View-based application" and save the project as "Test", and then start with JUST the skeleton files Xcode creates for me, what needs to go where in order for me to be able to call the methods in the AddressBookUI framework?

I hope I've made sense here, and provided all the information needed for somebody smarter than me to post a helpful response; if not, let me know and I'll rephrase or give more info.

Thanks in advance.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.