Objc_msgsend (Obj,normalselector,command) only supports 32-bit errors if the assignment of a class can occur in 64 bits such as:
If obj is a Cdvplugin class Normalselector is a method selector (that is, @selector (method name)) The parameter of the method is command (Cdvinvokedurlcommand Class)
The command's original attribute was successfully passed after the 32-bit execution, but the command's class changed to Cdvplugin ( actually occurred and measured on my project ) in 64 bits.
Modification Method:
Changed to: ((void (*) (Id,sel,id)) objc_msgsend) (Obj,normalselector,command);
Apple's official recommendation:
- (int) doSomething:(int) x { ... }- (void) doSomethingElse { int (*action)(id, SEL, int) = (int (*)(id, SEL, int)) objc_msgSend; action(self, @selector(doSomething:), 0);}
可以简写为: ((int(*)(id,SEL,int)))objc_msgSend)(self,@selector(doSomething:),0);
Pro-Test effective
IOS Objc_msgsend 32-bit and 64-bit