Objective-C: NSArray of weak references
Need an array of weak references? e.g. for delegates. Here’s some good tips.
One convenient way is to box it in a NSValue with a non-retained object.
NSValue *value = [NSValue valueWithNonretainedObjectValue:myObj]; [array addObject:value]; and when you get the object: value = [array objectAtIndex:x]; myObj = [value nonretainedObjectValue];
Yoink. Thanks.

Nice one, exactly what I need.