Does NSValue free its value when freed?
问题 Have a look at this pseudocode: void* magicpointer = malloc(OVER_NINE_THOUSAND); NSValue* v = [NSValue valueWithPointer:magicpointer]; [v release]; When v is released, does magicpointer get freed as well, or do I have to do that manually? I am using manual reference counting. 回答1: It doesn't get freed - NSValue is just a wrapper so you can treat arbitrary values as objects. It doesn't do anything with the wrapped pointer. 回答2: No, NSValue won't. Sounds like you might want to use NSData , it