Q:

Objective C, A Question about releasing an object

If I do something like 
address = [[NSString alloc] initWithData:addressData encoding:NSASCIIStringEncoding];

Then I know that I need to do like [address release] after I am done with using it.
Because "alloc" increases the reference count of "address" variable so that I need to do
 [address release]

But I am not sure that I need to release if I do something like 
 NSData *addressData = [NSData dataWithBytes:buf length:address_len];

I don't see any "alloc" in this statement..So do I still need to do [addressData release] after I am done with this? 
Thanks in advance...

A:

No, you don't. You only need to release (or autorelease) an object if the method you got the object from is alloc, contains the word copy, or if you've retained the object.

