0

how I can use an NSMutableArray of NSMutableDictionary's in an NSTableView using Cocoa? Can any one pls suggest me with proper solution?

iPatel
  • 46,010
  • 16
  • 115
  • 137
Preethi
  • 371
  • 2
  • 6
  • 20

1 Answers1

0

Consider the following example:

- (UITableViewCell *)tableView:(UITableView *)tableView 
         cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }

    // I will use tempDict Object for your understandings, otherwise it can be used directly. Here array1 is Main DataSource for UITableView.
    NSDictionary *tempDict = [array1 objectAtIndex:indexPath.row];

    // key1 is the key to get the object from the dictionary.
    cell.title.text = [tempDict valueForKey:key1];

    return cell;
}

Here, array1 is the main DataSource for your table view, which contains NSDictionary objects.

Hope this helps.

viral
  • 4,168
  • 5
  • 43
  • 68