开发者

Sendind pointers to different process and using them?

Is it possibl开发者_C百科e to send a pointer to an object via Mach IPC by casting it into an int and then casting it back into the object. Would that work and how can that be done?

I want to send a CALayer object over to a different process. I don't think I can send raw objects via Mach IPC.


That won't work, because pointers are specific to the memory of the process that they originate in. If you send a pointer to a different process, it will point to invalid memory if you're lucky. If you're unlucky it will point to valid memory, but to a completely different object than the one you wanted.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜