Re: premature dealloc of the datasource of a NSTableView crashes my application

2008-10-05 Thread Jonathan Hess
On Oct 5, 2008, at 6:32 AM, Dr. Rolf Jansen wrote: Am 05.10.2008 um 00:36 schrieb Michael Ash: On Sat, Oct 4, 2008 at 4:01 PM, Dr. Rolf Jansen <[EMAIL PROTECTED]> wrote: Mac OS X 10.5.5, Xcode 3.1.1, PowerBook G4. ... In order to prevent my application from crashing, I overwrote -[NSObje

Re: premature dealloc of the datasource of a NSTableView crashes my application

2008-10-05 Thread Michael Ash
On Sun, Oct 5, 2008 at 1:31 PM, Brian Stern <[EMAIL PROTECTED]> wrote: > > On Oct 4, 2008, at 11:36 PM, Michael Ash wrote: >> >> Absolutely not. Write your code to work with any order. In this case, >> what you should do is write your data source to nil out the table's >> reference to it when it go

Re: premature dealloc of the datasource of a NSTableView crashes my application

2008-10-05 Thread Nick Zitzmann
On Oct 5, 2008, at 7:32 AM, Dr. Rolf Jansen wrote: Anyway, now I cannot understand, why the NSTableView does not retain the dataSource, when it still needs it? Delegates and data sources don't get retained in order to avoid retention loops. If the table view did retain its delegate and da

Re: premature dealloc of the datasource of a NSTableView crashes my application

2008-10-05 Thread Brian Stern
On Oct 4, 2008, at 11:36 PM, Michael Ash wrote: Absolutely not. Write your code to work with any order. In this case, what you should do is write your data source to nil out the table's reference to it when it goes away: - (void)dealloc { [tableView setDataSource:nil]; [super dealloc]; }

Re: premature dealloc of the datasource of a NSTableView crashes my application

2008-10-05 Thread Dr. Rolf Jansen
Am 05.10.2008 um 00:36 schrieb Michael Ash: On Sat, Oct 4, 2008 at 4:01 PM, Dr. Rolf Jansen <[EMAIL PROTECTED]> wrote: Mac OS X 10.5.5, Xcode 3.1.1, PowerBook G4. ... In order to prevent my application from crashing, I overwrote -[NSObject dealloc] of the datasource to the following: - (void

Re: premature dealloc of the datasource of a NSTableView crashes my application

2008-10-05 Thread Michael Ash
On Sun, Oct 5, 2008 at 9:32 AM, Dr. Rolf Jansen <[EMAIL PROTECTED]> wrote: > Am 05.10.2008 um 00:36 schrieb Michael Ash: > >> On Sat, Oct 4, 2008 at 4:01 PM, Dr. Rolf Jansen <[EMAIL PROTECTED]> wrote: >> >>> Mac OS X 10.5.5, Xcode 3.1.1, PowerBook G4. >>> >>> ... >>> In order to prevent my applicat

Re: premature dealloc of the datasource of a NSTableView crashes my application

2008-10-04 Thread Michael Ash
On Sat, Oct 4, 2008 at 4:01 PM, Dr. Rolf Jansen <[EMAIL PROTECTED]> wrote: > Mac OS X 10.5.5, Xcode 3.1.1, PowerBook G4. > > I have developed a Document Based Cocoa application, and the main document > window contains a simple datasource based NSTableView. After I recently > re-built everything wit

premature dealloc of the datasource of a NSTableView crashes my application

2008-10-04 Thread Dr. Rolf Jansen
Mac OS X 10.5.5, Xcode 3.1.1, PowerBook G4. I have developed a Document Based Cocoa application, and the main document window contains a simple datasource based NSTableView. After I recently re-built everything with Xcode 3.1.1, my application crashes when I close any document window. Every