Can we use the ABPeoplePicker view for something other than selecting a single contact?
-
03-07-2019 - |
Question
I'm attempting to implement a 'better' address book for IPhone and I just want to make additions to Apple's current address book interface. Do I have to re-implement everything from scratch (contacts divided by letter headers, all alphabet buttons on the right, and so on) or is there a way I can somehow use and modify the PeoplePicker view?
(I'm still pretty new to the IPhone SDK, feel free to ask any questions that will help elaborate my question.)
Solution 2
from Oreilly's "iPhone SDK Application Development" book
here is a more detailed answer of:
Well, with UITableView you can do pretty much 100% what the regular "select a contact from a list" part of the addressbook does and then build upon that.
You basically have to implement sections and the index bar methods for a UITableView. (based on my shallow reading) the following methods need to be implemented:
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection (NSInteger)section
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;
- (NSInteger)tableView:(UITableView *)tableView sectionForSection IndexTitle:(NSString *)title atIndex:(NSInteger) index
OTHER TIPS
Well, with UITableView you can do pretty much 100% what the regular "select a contact from a list" part of the addressbook does and then build upon that.