私はこのプロジェクトを、2列の文字列を持つ単純なplistで開始しました。私は今、より多くの情報を追加すると、このplistの構造を使用したい:plistをTableViewに読み込む
Root - Dictionary - (2 items)
Standard - Array - (3 items)
Item 0 - Dictionary - (4 items)
Color - String - Red
Rvalue - String - 255
Gvalue - String - 0
Bvalue - String - 0
のplistで入力については申し訳ありません
が、サイトは私がイメージ
を投稿することはできないだろう、私はRGBの値があることができることを知っています文字列ではなく数字ですが、文字列である理由があります。
これは、私はシンプルなplistを読み取るために使用されるコードは次のとおりです。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
NSUInteger section = [indexPath section];
NSUInteger row = [indexPath row];
NSString *key = [keys objectAtIndex:section];
NSArray *colorSection = [colors objectForKey:key];
static NSString *SectionsTableIdentifier = @"SectionsTableIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:SectionsTableIdentifier];
if(cell == nil){
cell=[[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier: SectionsTableIdentifier] autorelease];
}
cell.textLabel.text = [colorSection objectAtIndex:row];
[cell setAccessoryType:UITableViewCellAccessoryDetailDisclosureButton]; //add disclosure button to rows
return cell;
}
私の質問cell.textLabel.textの色を取得するには、カラー辞書の内容を取得するために特定のコードが何であるかでありますまた、RGB値を読み込んで字幕を追加します。私は数日間この作業をしてきましたが、参考文献とたくさんの例を読んでいて、残念ながら問題を解決することはできません。あなたのお手伝いをさせていただきます。