从共享内存中推入和检索ObjC中的NSObject指针的示例? [英] An example of pushing and retrieving of an NSObject's pointer in ObjC from Shared Memory?

查看:65
本文介绍了从共享内存中推入和检索ObjC中的NSObject指针的示例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道共享对象(例如分布式对象)的更好方法,但是我的处境相当困难。我正在开发两个并行运行且需要共享对象的iPhone应用程序。该对象恰好是 CALayer ,并且两个应用程序都需要访问该对象。第二个应用程序将第一个应用程序的 CALayer 添加到第一个应用程序的 CALayer 中,并在那里工作。

I know that there are better ways of sharing objects such as distributed objects but my situation is quite difficult. I'm working on two iPhone apps which are running parallely and need to share an object. That object happens to be a CALayer and it needs to be accessible by both applications. Second application adds its own CALayer to the first app's CALayer and does its work there.

看到正在使用共享内存,但是我找不到执行我所需要的任何有用的示例。有人可以演示将指针推到共享内存中,然后检索它并将其序列化回 CALayer 对象吗?

The only way I see is using Shared Memory, but I couldn't find any useful examples of doing exactly what I need. Could someone demonstrate pushing the pointer into shared memory, then retrieving it and serializing it back into the CALayer object?

PS :我知道AppStore的政策,因此不需要其他有关这些政策的讲座。

P.S.: I am aware of the AppStore policies and I don't need another lecture regarding them.

推荐答案

专用剪贴板,其名称只有您的应用知道。这就是其他名称的共享内存,您可以免费获得更改通知和其他东西。

Private pasteboard with a name that only your apps know. That's shared memory by other name, and you get free change notifications and stuff.

这篇关于从共享内存中推入和检索ObjC中的NSObject指针的示例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆