Я пытаюсь создать пользовательский метод установки для nsdateformatter.Я не уверен, является ли это утечкой и оптимизировано.правильно ли выполнено управление памятьюЯ вижу здесь утечку.Я не знаю почему.,.
@property (nonatomic, retain) NSDateFormatter *customDateFormatter;
...
@synthesize customDateFormatter;
..
- (NSDateFormatter *)customDateFormatter
{
if (customDateFormatter == nil)
{
[self setCustomDateFormatter:[[NSDateFormatter alloc] init]];//it leaks here :(
[self.customDateFormatter setLocale: self.locale];
[self.customDateFormatter setDateFormat:@"h:mm:ss"];
}
return self.customDateFormatter;
}
-(void) dealloc
{
[customerDateFormatter release];
self.customDateFormatter = nil;
[super dealloc];
}