Alternative to Objective-C Objects in Structures (ARC)

I have the following code here that will not work on ARC, since it combines Objective-C objects into structs:

struct SingleToManyRelation {
    id singleObject;
    NSSet* manyObjects;
}

I know this is reminiscent of Core Data, but it isn’t;) I'm just looking for a solution to implement something like this without creating a “container” class.

Thanks in advance for your advice, Christian

+3
source share
1 answer

Give your objects an attribute __unsafe_unretained, and ARC will stop complaining (but keep in mind that they are not saved! Therefore, you need to somehow maintain a strong relationship with them if you do not want to lose them)

+5
source

All Articles