NSValue *value = [NSValue valueWithNonretainedObject:myObj]; [array addObject:value];2.現在的做法
NSObject *object = [[NSObject alloc] init]; NSLog(@"object.retainCount %i", object.retainCount); NSHashTable *hashTable = [NSHashTable weakObjectsHashTable]; [hashTable addObject:object]; NSLog(@"object.retainCount %i", object.retainCount);==== Log ===