我的initWithCoder漏洞了。 谁能帮我看看有什么不对?
在我的自定义类中,我尝试过使用self。没有......
-(id) initWithCoder: (NSCoder *) decoder {
if( self = [super init] )
{
persons = [[decoder decodeObject] retain];
title = [[decoder decodeObject] retain];
}
return self;
}
-(id) initWithCoder: (NSCoder *) decoder {
if( self = [super init] )
{
self.name = [decoder decodeObject];
self.address = [decoder decodeObject];
self.email = [decoder decodeObject];
self.comment = [decoder decodeObject];
}
return self;
}
NSData *getData = [[[NSData alloc] initWithContentsOfFile:path] autorelease];
Group = [[NSKeyedUnarchiver unarchiveObjectWithData:getData] retain];
......
......
......
[Group release];