How to “fake” ivars in an Obj-C category (iPhone)

后端 未结 5 1127
鱼传尺愫
鱼传尺愫 2021-02-09 16:13

Update:

iPhone OS 3.1 has associated objects. However, the iPhone simulator does not. If you want to test associated objects code in the simulator, you should file a bug

5条回答
  •  长发绾君心
    2021-02-09 16:36

    Notwithstanding concerns for concurrency issues, why not just use global variables ? Even using runtime objc_set/get AssociatedObject() methods aren't you passing a "global" static variable address in which case you still have concurrency issues wouldn't you?

提交回复
热议问题