Post

Replies

Boosts

Views

Activity

Too many arguments to function call, expected 0, have 3
Any idea why such error when Apple Silicon enabled? Too many arguments to function call, expected 0, have 3 The error is on line NSMethodSignature *ret = instanceMethodForSelectorIMP( self->targetObjectClass, @selector(instanceMethodSignatureForSelector:), aSelector ); (NSMethodSignature *)methodSignatureForSelector: (SEL)aSelector {  //DEBUGLOG( @"" );  id obj = [ self resolveTargetObject ];  if( obj == nil ){   Method instanceMethod = class_getClassMethod( self->targetObjectClass, @selector(instanceMethodSignatureForSelector:) );   IMP instanceMethodForSelectorIMP = method_getImplementation( instanceMethod );          NSMethodSignature *ret = instanceMethodForSelectorIMP( self->targetObjectClass, @selector(instanceMethodSignatureForSelector:), aSelector );   return ret;  }  return [ obj methodSignatureForSelector: aSelector ]; }
2
0
3.0k
Nov ’20
"Too many arguments to function call" with xCode 12
Any idea why such error when Apple Silicon enabled? Too many arguments to function call, expected 0, have 3 On line id serializedObject = deserializedObjectFromObjectIMP( cls, @selector(deserializedObjectFromObject), [ dict objectForKey: @"object" ] ); (id)deserializedObjectFromDictionary: (NSDictionary *)dict { NSString *className = [ dict objectForKey: @"class" ]; Class cls = NSClassFromString( [ self classNameForSerializedClassName: className ] ); if( cls == nil ){ [ NSException raise: NSInvalidArgumentException format: @"Cannot deserialize instances of class %@ : Class not found.", className ]; return nil; } IMP deserializedObjectFromObjectIMP = DMObjectSerializationFindImplementationForSelector( cls, @selector(deserializedObjectFromObject:) ); if( deserializedObjectFromObjectIMP == NULL ){ [ NSException raise: NSInvalidArgumentException format: @"Cannot deserialize instances of class %@ : Class does not respond to deserializedObjectFromObject.", className ]; return nil; }   id serializedObject = deserializedObjectFromObjectIMP( cls, @selector(deserializedObjectFromObject), [ dict objectForKey: @"object" ] ); return serializedObject;
3
0
1.4k
Nov ’20