Alternative to Objective-C objects in structs (ARC)

前端 未结 1 1072
孤街浪徒
孤街浪徒 2021-01-21 08:26

I have the following code here that won\'t run on ARC since it combines Objective-C objects in structs:

struct SingleToManyRelation {
    id singleObject;
    NS         


        
1条回答
  •  被撕碎了的回忆
    2021-01-21 09:01

    Give your objects the __unsafe_unretained attribute and ARC will stop complaining (but keep in mind that they aren't retained! So you have to somehow store a strong relationship to them, if you don't want to lose them)

    0 讨论(0)
提交回复
热议问题