Hi eric,

As I mentioned earlier, it is good practice to set your delegate/ds to nil, 
since people inadvertently don't realize when they tell the table to redraw, 
and are 
surprised when they get the delegate messages after they are deallocd. I looked 
at your app, and I can point out the problem (I didn't run it, sorry):

- (void) dealloc
{
        NSArray*        tableColumns = [table tableColumns];
        MyColumn*       column;
        
        for ( column in tableColumns )
        {
                [table removeTableColumn:column];
        }
        
        [table release];
        
        [super dealloc];
}

You are removing table columns, which the table marks that area as dirty, and 
redraws. Which calls your delegate/datasource (which is dealloced, clearly, 
since it is in dealloc)

That's what you are doing wrong in your code. It's okay to do it there as long 
as you realize what is happening...but I would recommend not doing it there , 
since it has side effects, and causes this problem you see.

Running instruments would point out the msg send was to your class.

corbin


On Jan 19, 2011, at 3:35 PM, Eric Gorr wrote:

> Hi Corbin,
> 
> I'm not using a custom cell. Just the standard text field one. I would assume 
> that it has implemented -copyWithZone correctly :-)
> 
> Feel free to check out the sample project, but I believe the correct answer 
> is to just set the datasource and delegate to nil as things are being 
> deallocated. The fact that I wasn't doing something I should be doing (?) is 
> what was causing it to crash.
> 
> Since it may  not have been clear, after pushing the button, which is when 
> the crash occurs, causes the modal event loop to end and everything to be 
> deallocated.

_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [email protected]

Reply via email to