8 Mar 2010, 12:04pm

2 comments

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];

Nice one, exactly what I need.

8 Nov 2011, 8:10pm
by Danyal


Yoink. Thanks.

 
*name

*e-mail

web site

leave a comment


 

free winrar download

free winrar download

winrar download free

winrar download free

windows 7 key generator

windows 7 key generator

windows 7 activation crack

windows7 activation crack

free winzip

free winzip

free winrar

free winrar

winzip free download

winzip free download

winrar free download

winrar free download

windows 7 crack

windows 7 crack

winzip free download full version

winzip free download full version

winzip activation code

winzip activation code

windows 7 product key

windows 7 product key
\n