私はアルファベット順にセルの値を手配したいが、私は、セルを手配することができますどのようにアルファベット順(Xcodeの)
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
cell.textLabel.text = [[[map annotations] objectAtIndex:indexPath.row] title];
return cell;
}
に私が働いている値 コードを手配することができないのですアレンジする方法について説明します。 textLabel.text値はアルファベット順に、任意のヘルプは方法があまりにも遅れていることを事前
これはこれを行う方法ですか? [[[map annotations] title] sortedArrayUsingSelector:@セレクタ(localizedCaseInsensitiveCompare :)]; – jarus
それは動作しません。 @middaparkaが記述するように配列をソートする必要があります。 – bbum
@ middaparka cellforrowatindexpathの前にそれをやる方法を知らなかったけど、私はcellforrowatindexpathの中でそれをやり遂げることができました、それは働いていましたが、それはメモリエラーにつながります – jarus