0
我已经整理SQLite中的名字我的数据:按名称排序sqlite的什么返回联合国numberOfRowsInSection
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
}
,但我需要的数据进行排序的字母 – user1763326
看看这个。 http://stackoverflow.com/questions/4197842/iphone-how-to-use-core-data-in-an-already-created-program –