• 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: ObjectAlloc and objects that should have been released
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ObjectAlloc and objects that should have been released


  • Subject: Re: ObjectAlloc and objects that should have been released
  • From: Miles <email@hidden>
  • Date: Fri, 24 Apr 2009 17:28:10 -0700

I just mean that I'm adding some labels and images to the view. I have
quadruple checked that they are all being released, but I must be
overlooking something.
For example, ObjectAlloc points to the second line here, where I declare
UIImage *logo as being created and still living, even though it's obviously
release right afterwards:

    NSString *iconImageString    = [[NSBundle mainBundle]
pathForResource:@"big_logo"
ofType:@"png"];
    UIImage *logo                = [[UIImage alloc]
initWithContentsOfFile:iconImageString];
    UIImageView *logoView    = [[UIImageView alloc] initWithImage: logo];
    [logo release];
    logoView.frame    = CGRectMake(44, 32, 205, 32);

    [self.view addSubview:logoView];
    [logoView release];

There are a bunch of little things like this. And, none of these objects are
referenced from outside of this view controller -- only the creation and
destruction of the view controller.

Another one it points to is the line where I set the timer to nil:

+(void)stopToss {
    if( tossTimer != nil ) {
        [tossTimer invalidate];
        tossTimer = nil;
    }
}

Thoughts?


On Thu, Apr 23, 2009 at 11:12 PM, Alexander Spohr <email@hidden> wrote:

>
> Am 24.04.2009 um 01:27 schrieb Miles:
>
>  But when I run this in ObjectAlloc, a bunch of parts of the view are still
>> showing as 'created and still living'. It's very odd considering the
>> deallocs are both called so nothing should be hanging around.
>>
>
> What is „a bunch of parts of the view“ in your case? You talk about two
> deallocs but „a bunch“ sounds more than two. Are you sure you release all
> retained vars in your dealloc?
> Maybe you have a cross-retain? (if you don’t use the GC).
>
>        atze
>
>
_______________________________________________

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: ObjectAlloc and objects that should have been released
      • From: Peter N Lewis <email@hidden>
References: 
 >ObjectAlloc and objects that should have been released (From: Miles <email@hidden>)
 >Re: ObjectAlloc and objects that should have been released (From: Peter N Lewis <email@hidden>)
 >Re: ObjectAlloc and objects that should have been released (From: Miles <email@hidden>)
 >Re: ObjectAlloc and objects that should have been released (From: Alexander Spohr <email@hidden>)

  • Prev by Date: Re: Dividing NSView to subviews
  • Next by Date: Re: NSPopUpButtonCell causes UI to "sleep" when clicked
  • Previous by thread: Re: ObjectAlloc and objects that should have been released
  • Next by thread: Re: ObjectAlloc and objects that should have been released
  • Index(es):
    • Date
    • Thread