귀하의 솔루션에 감사드립니다. 그것은 위대한 작품. 실제로 descriptionWithLocale이 누설의 원인 이었지만 내 기억 규칙 구현 (1 년 전 :()이었습니다. 악기가 해당 메서드 호출을 가리키고 있다는 이상한 점 ... .... 지금 내 수업이 어떻게 보이는지 보아주십시오 :
@implementation EventItem
@synthesize eventString, detailsString, date;
-(id)initEvent:(NSString*)eventStr details:(NSString*)detailsStr{
if((self = [super init])){
self.eventString = [[NSMutableString alloc] initWithString:eventStr];
self.detailsString = [[NSString alloc] initWithString:detailsStr];
self.date =[[NSMutableString alloc] init];
NSDate* currentDate = [NSDate date];
NSString *dateDescStr = [currentDate descriptionWithLocale:[NSLocale systemLocale]];
[date appendString:dateDescStr];
[eventString release];
[detailsString release];
[date release];
}
return self;
}
-(NSMutableDictionary*)eventDictionary{
if(!dictionary)
dictionary = [[NSMutableDictionary alloc] init];
else
return dictionary;
[dictionary setObject:self.date forKey:@"Event"];
[dictionary setObject:self.date forKey:@"Date"];
[dictionary setObject:self.detailsString forKey:@"Details"];
[dictionary setObject:self.eventString forKey:@"EventDescription"];
return [dictionary autorelease];
}
-(void)dealloc{
// NSLog(@"dealloc called in EventItem");
[eventString release];
[detailsString release];
[date release];
[super dealloc];
}
@end
"loadWithContentsOfFile :"
- (void)viewDidLoad {
[super viewDidLoad];
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.tableView.rowHeight = OC_CELL_HEIGHT;
self.tableView.backgroundColor = [UIColor clearColor];
UIImage* backgroundImage = [[UIImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"TableBg" ofType:@"png"]];
UIImageView* background = [[UIImageView alloc] initWithFrame:self.tableView.frame];
background.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
background.image = backgroundImage;
[background sizeToFit];
[backgroundImage release];
[self.tableView setBackgroundView:background];
[background release];
[self.tableView setAutoresizesSubviews:YES];
selectedOCData = nil;
self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin;
}
라인 :
이제, 내가 가진 또 다른 문제를 통해로드 일부 이미지에 관련되어
UIImage* backgroundImage = [[UIImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"TableBg" ofType:@"png"]];
누출 98 %와 haviest 역 추적입니다 240kb. 이 도구로 스크린 샷을 첨부했습니다. initWithContentsOfFile의 실제 호출이 아니라 tableView가 올바르게 할당 해제되지 않은 문제가 있습니까? (내 클래스는 tableViewController 임).
감사합니다. 알렉스.
그 코드에서 알기는 어렵지만 기본적으로 정확합니다. 'tableView'를 클래스 프로퍼티로 다루기 때문에'dealloc' 메쏘드에서'tableView'의 할당을 해제해야합니다. 좀 더 자세한 도움이 필요하면 새로운 질문을 시작하는 것이 좋습니다. – Kongress