I'm wondering what the safest way is to release an object and Re-instantiate it again.
What I'm doing is this and it seems to work but I'm not sure if this is not creating a memory leak ?
- (void)reLoadCalendarObject
{
if (self.calViewController != nil)
self.calViewController = nil; //release instantiated object
CalViewController *tempCalViewController = [[CalViewController alloc]initWithDate:[NSDate dateWithTimeIntervalSinceNow:0.0f] observer:self];
self.calViewController = tempCalViewController;
[tempCalViewController release];
self.calViewController.dataSource = self.calendarDataSource;
}
self.calViewController
property is declared as (nonatomic,retain)