Alternative to Objective-C objects in structs (ARC)

automatic-ref-counting, objective-c, struct

Solution

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)

Problem

I have the following code here that won't run on ARC since it combines Objective-C objects in structs: ``` struct SingleToManyRelation { id singleObject; NSSet* manyObjects; } ``` I know this is reminiscent of Core Data, but that's not the point ;) I am just looking for a solution to implement something like that without having to create a "container" class. Thanks in advance for your advices, Christian

Original source