Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you want to store table in plist it is better to consider the following structure:</p> <pre><code>NSArray *sections = [NSArray arrayWithObjects: [NSDictionary dictionaryWithObject: [NSArray arrayWithObjects:row_1, row_2, ... , nil] forKey:@"section name 1"], [NSDictionary dictionaryWithObject: [NSArray arrayWithObjects:row_1, row_2, ... , nil] forKey:@"section name 2"], ... [NSDictionary dictionaryWithObject: [NSArray arrayWithObjects:row_1, row_2, ... , nil] forKey:@"section name N"], nil]; </code></pre> <p>This code representation is easy to reproduce as plist. Create it as in example below</p> <p><img src="https://i.stack.imgur.com/Byhrd.png" alt="enter image description here"></p> <p>This structure can be easily used as UITableView datasource</p> <pre><code>- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return [self.datasource count]; } - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { NSDictionary *dict = [self.datasource objectAtIndex:section]; return [dict.allKeys lastObject]; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { NSDictionary *dict = [self.datasource objectAtIndex:section]; return [dict.allValues.lastObject count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSDictionary *dict = [self.datasource objectAtIndex:indexPath.section]; id cellPresenter = [dict.allValues.lastObject objectAtIndex:indexPath.row]; ... } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

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