tags:

views:

384

answers:

2

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.)

+2  A: 

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.

Andrew Grant
yes but I have to reinvent the wheel...
chaostheory
You're already doing that, so why not a little more?
ceejayoz
not yet - my question is basically asking if I have to reinvent it. I guess it's just my personal preference that I don't do any extra work that's not required. Since time is a valued commodity and I'd rather spend it on stuff that counts.If I don't have a choice, that's fine too; just not ideal.
chaostheory
My point is that TableView is already 90% of the wheel (headers, sections etc). If you want an exact copy, how is that a "better" address book?
Andrew Grant
I guess I'm just lazy; much appreciated for the reply
chaostheory
A: 

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
chaostheory
you may want to look at some of the iPhone samples in the SDK, particularly the timezone ones. They demonstrate all this and more.
Andrew Grant
cool - thanks for the help and info so far Andrewgeez you're up late hehe
chaostheory