Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As per the comment "I appreciate the code example, but unfortunately I need a cell based tableview in order to run on versions of OS X prior to 10.7."</p> <p>In that case, You can comment the method</p> <pre><code>- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row </code></pre> <p><em>And you can use the delegate method(willDisplayCell) for that replacement. Make sure you remove the method and make the table view as cell based. Drag and drop check box(NSButtonCell). Implement the same. Rest all remains the same.</em></p> <pre><code>/* Delegate Method For the same example explained in the above answer */ - (void)tableView:(NSTableView *)tableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { NSUInteger tableCol = [tableView.tableColumns indexOfObject:tableColumn]; if(tableCol == 0) { NSDictionary *valueDictionary = [self.myArray objectAtIndex:row]; NSString *titleValue = [valueDictionary valueForKey:@"Name"]; [cell setTitle:titleValue]; NSUInteger mod = row % 2; if(mod == 0) { [cell setState:NSOnState]; } else { [cell setState:NSOffState]; } } else { [cell setTitle:@"Column 2"]; } } </code></pre> <p>This should be what you are expecting : )</p> <p>For your information: The Table View Object should be in following way:</p> <p><img src="https://i.stack.imgur.com/fkInG.png" alt="enter image description here"> </p> <p>And the Table View Bindings should be in the below way</p> <p><img src="https://i.stack.imgur.com/EETTR.png" alt="enter image description here"></p> <p>And the Array Controller Binding should be in the below way:</p> <p><img src="https://i.stack.imgur.com/Wm3fC.png" alt="enter image description here"></p> <p>Let me if you are still facing the issue.</p>
    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. This table or related slice is empty.
    1. 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