• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSTableView retain count problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTableView retain count problem


  • Subject: NSTableView retain count problem
  • From: Shane <email@hidden>
  • Date: Sat, 21 Nov 2009 17:49:54 -0600

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 (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSTableView retain count problem
      • From: Mark Munz <email@hidden>
    • Re: NSTableView retain count problem
      • From: "Hank Heijink (Mailinglists)" <email@hidden>
    • Re: NSTableView retain count problem
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: Problems understanding CALayer geometry
  • Next by Date: Re: NSTableView retain count problem
  • Previous by thread: Re: Problems understanding CALayer geometry
  • Next by thread: Re: NSTableView retain count problem
  • Index(es):
    • Date
    • Thread