开发者

iphonesdk contact listing indexing problem

i开发者_C百科 want to index my contact with alphabets but i am not getting the correct result, suppose if i click a, b or c in each section it showing all of the contacts ? how can i make sure that contact name starts with A will be indexed only in A section. and others in there respective sections, thanks in advance.

-(NSInteger)tableView:(UITableView *)aTableView numberOfRowsInSection:(NSInteger)section 
{
    // Normal table
    if (aTableView == tableView) 
        return self.contacts.count;
}


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    //  return self.contacts.count;
    return self.contacts.count;
}

Iam using Abcontact class.

also attached image for more clarification.

iphonesdk contact listing indexing problem


you should implement

- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView; 
- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index; 

try use those tutorials

http://www.iphonedevcentral.com/indexed-uitableview-tutorial/

http://ved-dimensions.blogspot.com/2009/04/iphone-development-creating-native.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜