我在 sqlite 中按名称对数据进行了排序:
char*sql="SELECT* FROM tblcocktail ORDER BY drinkname ;";
我不知道如何在按字母排序的表格中显示它:请指教:)
-(void)viewDidAppear:(BOOL)animated
{
Cocktails*cock=[[Cocktails alloc]init];
_arrcocktail=[cock getallcocktail];
[self.tableView reloadData];
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return [_arr count]; //all the letters
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
//i don't not what to put here so it will show me the right name under the right letter
}