I'm having trouble with the following code, where Xcode is flagging a memory problem. The warnings are below the code, on the return line. Does anybody know why, and what I can do about it?
- (id)copyWithZone:(NSZone *)zone
{
NSData *archivedData = [NSKeyedArchiver archivedDataWithRootObject:self];
return [NSKeyedUnarchiver unarchiveObjectWithData:archivedData];
}
Mvariable.m:177:2: Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected
Mvariable.m:177:9: Method returns an Objective-C object with a +0 retain count
Mvariable.m:177:2: Object returned to caller with a +0 retain count
Mvariable.m:177:2: Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected