Reputation: 136
based on the alphabetical selection i can display data in UITableView.
my searching capability will reduces the with the help of alphabetical selections
Any example links. please help me out.
Upvotes: 2
Views: 2422
Reputation: 10172
You can use segmented table withsorted array, if you want segementation according to alphabate. and to full fill the requirnment of sorted data display.. you only need to sort the source of data.
Upvotes: 0
Reputation: 2041
I found this tutorial to be useful. It contains the code as well as explanations:
http://www.iphonedevcentral.com/indexed-uitableview-tutorial/
As a quick summary, the gist is that you need to implement two methods:
-(NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView {
//The array of strings to use as indices
}
-(NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index {
//The index (integer) of the current section that the user is touching
}
Upvotes: 2
Reputation: 15628
You can sort the array by using this code.
sortedArray = [yourArray sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)];
checkout the apple's Documentation for more details
Upvotes: 0