Note that there are some explanatory texts on larger screens.

plurals
  1. POReading plist into TableView
    text
    copied!<p>I started this project with a simple plist of a dictionary with two arrays of strings. I now want to add more information and want to use this plist structure:</p> <pre><code>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 </code></pre> <p>Sorry about typing in the plist but the site would not let me post an image</p> <p>I know that the RGB values could be numbers instead of strings but I have a reason for them being strings.</p> <p>This is the code I used to read the simple plist:</p> <pre><code>- (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; } </code></pre> <p>My question is what is the specific code to retrieve the contents of the color dictionaries to get the Colors for the cell.textLabel.text and also read the RGB values to add a subtitle. I've been working on this for several days and have read references and lots of examples and unfortunately can't solve the problem. Your assistance will be greatly appreciated.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload