On Jan 20, 2011, at 12:17 PM, Kyle Sluder wrote:

> On Thu, Jan 20, 2011 at 7:22 AM, Eric Gorr <mail...@ericgorr.net> wrote:
>> Based on my current understanding, the dealloc should be setting it's 
>> datasource and delegate to nil. Correct? If so, I will file a bug.
> 
> No. It is the responsibility of the delegate to set the table view's
> backpointer to nil. The delegate usually has an owning reference to
> the table view. If -dealloc is being called on the table view, but the
> delegate still has a pointer to the table view, that means a memory
> management error has occurred.

I think you misunderstood and I didn't write that sentence as clearly as I 
could.

For a specific example, check out the AnimatedTableView sample code from Apple. 
 The ATColorTableController class is a datasource for the table, but it's 
dealloc looks like:

- (void)dealloc 
{
   [_colorList release];
   [_colorNames release];
   [_window release];
   [super dealloc];
}

Based on my current understanding, the table controller's dealloc (above) 
should be setting the table datasource and delegate to nil. Correct? If so, I 
will file a bug.

Or, what is the reason why the code as written is correct?

_______________________________________________

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