I have a problem.
I have a method
- (void)forwardInvocation:(NSInvocation *)anInvocation { SEL sel = anInvocation.selector; NSString *prop = [self.class fieldNameForSelector:sel]; if (prop) { BOOL setter = [self isSetter:sel]; __unsafe_unretained id obj; if (setter) { [anInvocation getArgument:&obj atIndex:2]; [self setValue:obj forKey:prop]; } else { obj = [self valueForKey:prop]; [anInvocation setReturnValue:&obj]; } } else { [super forwardInvocation:anInvocation]; }
}
But if I try to get an NSDate or NSData object class, it will not work on a 64-bit device. I get EXC_BAD_ACCESS code=1
And a message from NSZombie
[__NSDate retain]: message sent to deallocated instance 0x171e00d50
But for another type object, it works. How can I solve this problem? Thanks you
ios exc-bad-access
Alexander
source share