Reputation:
for my iPhone Project, I woud love to use the TTpickerTextField from Three20 to let the User select a contact from the Addressbook. While I’m really new to cocoa, I don’t understand how to use the Addressbook as a DataSource. As far as I understand, I have to create my own DataSource, that means, get every entry from the Addressbook and put it in my own DataSource, correct? But what Delegate/Protocol do I have to implement in my class, so that my class is a DataSource? Or am I on the wrong way? Can someone give me a hint?
Thank you so much
dragi
Upvotes: 0
Views: 1021
Reputation: 14816
As Ken says, you'll want a class that implements the protocol TTTableViewDataSource
, and then to set an instance of that class as your field's dataSource
property.
Additionally, you'll want to review the Address Book Programming Guide for iPhone OS, which will point you to the APIs you need to get data out of the Address Book itself in your datasource class.
Upvotes: 0
Reputation: 13003
This is just from looking at the headers, but TTPickerTextField is a subclass of TTSearchTextField, which has this property:
@property(nonatomic,retain) id<TTTableViewDataSource> dataSource;
So, I would expect that your custom object should adopt the TTTableViewDataSource protocol.
Upvotes: 4