You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your Objective-C method is not variadic. Therefore any C implementation that you install using class_addMethod() must also be non-variadic. The call site (using the Objective-C method declaration) and the implementation (in your C function) must match. You must write a non-variadic C function to implement the non-variadic Objective-C method declaration, or you must write a variadic C function to implement a variadic Objective-C method declaration.
On arm64, variadic parameters and non-variadic parameters are passed differently. The expected result for a mismatch is undefined noise. Your reverse-order result is a coincidence and is likely to change with different code or compiler optimization. (This is true to some extent on some other architectures as well, but arm64 makes it even worse.)
參考
重點節錄
固定參數數量的
IMP
只可以去接固定參數數量的Method
,不固定參數數量的
IMP
只可以去接不固定參數數量的Method
,亂接是不正確的行為.....
The text was updated successfully, but these errors were encountered: