The following code implements an NSProxy subclass which forwards methods to an NSNumber instance.
However when calling [nsproxy floatValue] I get 0.0 under GCC 4.2.
Under LLVM-Clang I get the correct answer 42.0.
Any idea what is going on?
(by the way this is running under Garbage Collection)
-(id) init;
{
_result = [NSNumber numberWithFloat:42.0];
return self;
}
- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector
{
return [[_result class] instanceMethodSignatureForSelector:aSelector];
}
- (void)forwardInvocation:(NSInvocation *)anInvocation
{
[anInvocation setTarget:_result];
[anInvocation invoke];
return;
}