无法释放对象

时间:2010-11-23 15:00:33

标签: objective-c memory-management

我无法释放这个对象,我不知道为什么:

SchedVO *tmpSched;
tmpSched = [SchedVO alloc];
NSString *timeStr;
timeStr = [[node attributeForName:@"timestamp"] stringValue];
tmpSched.date = [NSDate dateWithTimeIntervalSince1970:timeStr.intValue];
tmpSched.uid = [node stringValue];
[playListArr addObject:tmpSched];
[tmpSched release];

附表:

@interface SchedVO : NSObject 
{
    NSDate      *date;
    NSString    *uid;
}

@property (nonatomic,retain) NSDate *date;
@property (nonatomic,retain) NSString *uid;


@end

我认为它是nsdate部分。有人可以帮助我吗?

1 个答案:

答案 0 :(得分:2)

我相信你错过了inittmpSched = [[SchedVO alloc] init]; Init将保留计数增加到1.您无法释放尚未初始化的内容。