On Dec 14, 2009, at 12:45 PM, Eric E. Dolecki wrote: > I was receiving malloc double free errors when a view removed itself, so all > of the releases I was doing in the view I commented out, the view killing > itself after it animates from visual view: > > - (void) killMe:(NSString *)animationID finished:(NSNumber *)finished > context:(void *)context { > > [self.view removeFromSuperview]; > > }
removeFromSuperview Unlinks the receiver from its superview and its window, and removes it from the responder chain. - (void)removeFromSuperview Discussion If the receiver’s superview is not nil, this method releases the receiver. =================== If you plan to reuse the view, be sure to retain it before calling this method and be sure to release it as appropriate when you are done with it or after adding it to another view hierarchy. =================== > I no longer receive the malloc double free errors. I was creating NSStrings > and NSDateFormatters (init type stuff), all of which I previously was > releasing myself. Does it sound reasonable that the removeFromSuperview was > cleaning all that up already and thus the releases caused the errors? I am > trying to still get my head around memory management. Cheers, . . . . . . . . Henry _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com