私はMaster-Detail Applicationテンプレートを使用しています。その後、私は5つの単語それぞれの二つの配列を作成し、別の配列にそれら二つの配列を置く文字列の配列からUITableの詳細テキストラベルを設定する
groups = [[NSArray alloc] initWithObjects:@"Group1", @"Group2", nil];
:のtableViewで
group1 = [[NSArray alloc] initWithObjects:@"A", @"and", @"find", @"go", @"have", nil];
group2 = [[NSArray alloc] initWithObjects:@"here", @"jump", @"not", @"on", @"one", nil];
groupWords = [[NSArray alloc] initWithObjects:group1, group2, nil];
:cellForRowAtIndexPath:私はハードテキストラベルを設定したNSArrayをコード化された私は、テキストを "Group#"とし、詳細テキストを単語のリストに設定しようとしています。私は各セルのテキストラベルを設定することができますが、各詳細テキストラベルを設定するために文字列の配列を渡す方法を理解できないようです。
例:
グループ1
A、及び、見つけ、行く、ここ
グループ2
を持って、1
、上のジャンプ、ではないが、ここにありますこれまで私が持っていたもの:
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
cell.textLabel.text = [groups objectAtIndex:[indexPath row]];
NSString *detailWords = [self.groupWords objectAtIndex:[indexPath row]];
NSLog(@"%@", detailWords);
cell.detailTextLabel.text =
return cell;
ご協力いただきまして誠にありがとうございます。
感謝。私はこれを使って作業していますが、私のプロジェクトではまだ作業していません。 –