Re: Delayed Autorelease

2010-04-08 Thread Patrick M. Rutkowski
Ah, a very good point, I'll turn that on right away; I can't believe I forgot that. Thanks :-) On Thu, Apr 8, 2010 at 11:40 AM, Joar Wingfors wrote: > > On 8 apr 2010, at 08.37, Patrick M. Rutkowski wrote: > >> Another mistake was self.array being initialized as >> self.array = [[NSMutableArray a

Re: Delayed Autorelease

2010-04-08 Thread Joar Wingfors
On 8 apr 2010, at 08.37, Patrick M. Rutkowski wrote: > Another mistake was self.array being initialized as > self.array = [[NSMutableArray alloc] init] > > when it should have been > self.array = [NSMutableArray array] > > I'm still somewhat new to this :-) > > I totally get what's going on, I

Re: Delayed Autorelease

2010-04-08 Thread Patrick M. Rutkowski
Sorry for the useless thread guys, I worked it all out :-) It was due to silly mistakes like forgetting to initialize the array in -init, and then having [self.array addObject: bar] be a no-op due to self.array being nil. Another mistake was self.array being initialized as self.array = [[NSMutabl

Re: Delayed Autorelease

2010-04-08 Thread Patrick M. Rutkowski
I meant that I believe that the array itself was still alive, but the Bar objects inside of it were getting dealloc'd > > How are Bars (no apostrophe) "living well" if they are deallocated? > > > > Steve Bird > Culverson Software - E

Re: Delayed Autorelease

2010-04-08 Thread Hank Heijink (Mailinglists)
On Apr 8, 2010, at 11:03 AM, Patrick M. Rutkowski wrote: > It turns out that my memory error is coming form somewhere else. If > you don't mind changing the topic of the thread for a moment: > > I have a Foo object which has an NSMutableArray of Bar objects. The > Bar objects each have their own

Re: Delayed Autorelease

2010-04-08 Thread Dru Satori
This is a really common problem for developers coming from other platforms. In the Windows world the only thing really analogous to retain/release is the COM addref concepts, and even those lack the equivalent of autorelease. The short version, in my experience, is when in doubt, manage the mem

Re: Delayed Autorelease

2010-04-08 Thread Joar Wingfors
On 8 apr 2010, at 08.03, Patrick M. Rutkowski wrote: > I have a Foo object which has an NSMutableArray of Bar objects. The > Bar objects each have their own NSMutableArray of Baz objects. > > The weird thing is that the Foo and it's array of Bar's are all living > well and good, but the Bar's ar

Re: Delayed Autorelease

2010-04-08 Thread Steve Bird
On Apr 8, 2010, at 11:03 AM, Patrick M. Rutkowski wrote: > It turns out that my memory error is coming form somewhere else. If > you don't mind changing the topic of the thread for a moment: > > I have a Foo object which has an NSMutableArray of Bar objects. The > Bar objects each have their own

Re: Delayed Autorelease

2010-04-08 Thread Steve Bird
On Apr 8, 2010, at 10:36 AM, Patrick M. Rutkowski wrote: > Is it common in either Cocoa or UIKit to have an autorelease run > happen only when the user does something? > > I'm in a situation where I believe the autorelease run is happening > only when I push a bush or otherwise fiddled with a UI

Re: Delayed Autorelease

2010-04-08 Thread Hank Heijink (Mailinglists)
On Apr 8, 2010, at 10:36 AM, Patrick M. Rutkowski wrote: > Is it common in either Cocoa or UIKit to have an autorelease run > happen only when the user does something? > I'm in a situation where I believe the autorelease run is happening > only when I push a bush or otherwise fiddled with a UI it

Re: Delayed Autorelease

2010-04-08 Thread Patrick M. Rutkowski
It turns out that my memory error is coming form somewhere else. If you don't mind changing the topic of the thread for a moment: I have a Foo object which has an NSMutableArray of Bar objects. The Bar objects each have their own NSMutableArray of Baz objects. The weird thing is that the Foo and

Delayed Autorelease

2010-04-08 Thread Patrick M. Rutkowski
Is it common in either Cocoa or UIKit to have an autorelease run happen only when the user does something? I'm in a situation where I believe the autorelease run is happening only when I push a bush or otherwise fiddled with a UI item; might that be the case, or am I confused? -Patrick P.S. Is t