That actually is a valid concern; since you're on the iPhone, memory constraints are tight, and your view may actually be unloaded at some point. Instead of doing additional initialization in awakeFromNib, (which has no counterpart), I'd recommend doing your additional setup in viewDidLoad: on the associated UIViewController. Then, in viewDidUnload: you can release anything you instantiated in viewDidLoad:. Note that viewDidUnload is only available in iPhone OS 3.0 and later.
-BJ On Sat, Jul 18, 2009 at 1:56 PM, DKJ <hatzicw...@shaw.ca> wrote: > Thanks to all who replied. I was concerned whether the object might somehow > get re-instantiated from the nib without dealloc being called first. If I > understand memory management correctly, that would produce a leak. > > I'm assuming that the object wouldn't be re-instantiated without its > previous instantiation being released. But I'd sleep better having an expert > opinion. > > dkj > > > > On 18-Jul-09, at 7:59 , DKJ wrote: > > I've got a UIView object that uses an NSDictionary. The UIView is >> instantiated from a nib, so I initialise the dictionary in awakeFromNib, >> since the initWithFrame: method is never called. Is it appropriate to >> release this dictionary in the UIView dealloc method? >> >> dkj >> _______________________________________________ >> > > _______________________________________________ > > 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/bjhomer%40gmail.com > > This email sent to bjho...@gmail.com > _______________________________________________ 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