I have an NSTableView where the data source and delegate are assigned
to an NSViewController, and in this controller I have the two data
source methods.

numberOfRowsInTableView
tableView: objectValueForTableColumn row:

This project was previously done through xcode using Tiger, and I've
just now imported it in Snow Leopard. My problem is that my table view
isn't being populated. I see numberOfRowsInTableView being called, but
it's always returning 0. So I looked at 'records' and the retain count
is always 0, yet 'records' in my other method 'createDictionary' which
populates the table is always 1.

@interface DataViewController : MainViewController {
        …
        NSMutableArray *records;
}

- (id) init
{
        records = [[NSMutableArray alloc] init];        
}

- (int) createDictionary
{
        [records autorelease];

        // retain count for records at this point is 1.

        while (…) {
                [records addObject:currentLine];
        }       

        [myTableView reloadData];

        // retain count for records at this point is 1.
        // records is not populated and returns the proper count.

        return [records count];
}


This method gets called before (when NSTableView is setup) and during
createDictionary (where I populate my NSTableView) and always returns
0.

- (int) numberOfRowsInTableView:(NSTableView *)tableView
{
    // retain count for records at this point is always 0.
    return [records count];
}


Anyone see what I'm doing wrong here, or know how I can better track this down?
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to