Today, I was trying to add an object to an NSDictionary
and force it to be a weak reference. This can be done with the [NSValue valueWithNonretainedObject]
call:
NSValue *weakRef = [NSValue valueWithNonretainedObject:loadDelegate];
NSDictionary *userInfo = [[NSDictionary alloc] initWithObjectsAndKeys:weakRef, @"loadDelegate", nil];