On Dec 11, 2009, at 1:06 pm, Alex Kac wrote: > if (timeSpanPicker) > { > //remove it > [timeSpanPicker removeFromSuperview]; > [timeSpanPicker release]; > > //now add it again > [self createRelativeTriggerTimeSpanPicker]; > } > I would strongly suggest replacing [timeSpanPicker release]; with [self setTimeSpanPicker:nil];
This is generally better form for memory management. Generally direct assignment is discouraged anywhere other than in initialiser methods, so I'd also suggest replacing timeSpanPicker = [[UITimeSpanPicker alloc] initWithFrame: CGRectZero]; with something more like: UITimeSpanPicker *aTimeSpanPicker = [[UITimeSpanPicker alloc] initWithFrame: CGRectZero]; self.aTimeSpanPicker = aTimeSpanPicker; [aTimeSpanPicker release]; mmalc _______________________________________________ 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