[futurebasic] Re: [FB] Dynamic arrays

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 2014 : Group Archive : Group : All Groups

From: Bernie <fblist.bw@...>
Date: Wed, 22 Oct 2014 13:14:43 +0200
rc wrote:

> dim dynamic gTableRowData(_maxCols,_maxInt) as tableRowDataRec
> Will just swap to an array of Dictionaries I guess (key value pairs for identifier and value)

Array of dicts is defintely the way to go for table view data (IMO). Matching dict keys and table column identifiers makes the data source objectValueForTableColumn: method simple:

- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex {
     return [[tableViewData objectAtIndex:rowIndex] objectForKey:[aTableColumn identifier]];