• 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
Re: Delayed Autorelease
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Delayed Autorelease


  • Subject: Re: Delayed Autorelease
  • From: "Patrick M. Rutkowski" <email@hidden>
  • Date: Thu, 8 Apr 2010 11:37:32 -0400

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 = [[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'm just not good at spotting the usual
mistakes yet; and I'm a bit sleepy at the moment.

Yawn,
-Patrick

On Thu, Apr 8, 2010 at 11:03 AM, Patrick M. Rutkowski
<email@hidden> 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 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 are all getting dealloc'd, even though
> their containing parent are still alive.
>
> Still digging into it; not quite sure that you guys would even have
> any advice to offer here, I think I'm on my own :-/
>
> -Patrick
>
> On Thu, Apr 8, 2010 at 10:36 AM, Patrick M. Rutkowski
> <email@hidden> 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 item; might
>> that be the case, or am I confused?
>>
>> -Patrick
>>
>> P.S.
>> Is there perhaps a way to have it logged to the console whenever an
>> autorelease run happens?
>>
>
_______________________________________________

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: Delayed Autorelease
      • From: Joar Wingfors <email@hidden>
References: 
 >Delayed Autorelease (From: "Patrick M. Rutkowski" <email@hidden>)
 >Re: Delayed Autorelease (From: "Patrick M. Rutkowski" <email@hidden>)

  • Prev by Date: Re: Delayed Autorelease
  • Next by Date: Re: Delayed Autorelease
  • Previous by thread: Re: Delayed Autorelease
  • Next by thread: Re: Delayed Autorelease
  • Index(es):
    • Date
    • Thread