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
As discussed in #156, it seems that blocks cannot be properly serialized to remote objects, when attempting a remote method call in a +load method, due to load order woes.
The code linked in the other issue shows that __attribute__((constructor)) is used, which is ordered later in the start chaing, after +load methods.
Moving the code to +load is also not the best solution, as +load are also subject to call order issues, as I recently discovered. I've settled on nasty hacks in my case. But those hacks aren't suitable here, as the code is in a class category.
The result is that when a block is called from the remote process, it is not serialized correctly on the client side (because the above-linked code has not executed yet), and an exception is raised +[NSInvocation _invocationWithMethodSignature:frame:]: method signature argument cannot be nil in:
We could actually implement those methods in NSBlock category, and the reason why we use the runtime API to add them dynamically is because we want to be cautious if there is a conflict and fail early.
One quick fix (probably the best fix) is, instead having a constructor, move the code into here using dispatch_once.
Unfortunately, I have opted to implement an IPC solution of my own for our project with the needs of asynchronicity. I may be able to test in the future, but not right now.
As discussed in #156, it seems that blocks cannot be properly serialized to remote objects, when attempting a remote method call in a
+load
method, due to load order woes.The code linked in the other issue shows that
__attribute__((constructor))
is used, which is ordered later in the start chaing, after+load
methods.Moving the code to
+load
is also not the best solution, as+load
are also subject to call order issues, as I recently discovered. I've settled on nasty hacks in my case. But those hacks aren't suitable here, as the code is in a class category.The result is that when a block is called from the remote process, it is not serialized correctly on the client side (because the above-linked code has not executed yet), and an exception is raised
+[NSInvocation _invocationWithMethodSignature:frame:]: method signature argument cannot be nil
in:The text was updated successfully, but these errors were encountered: