alloc + init memory usage mechanism

Viewed 162

I am just curious to know when an object has made by alloc, and a piece of memory allocated to it, why init don't use that piece of memory and changes the address of object?

NSDate *t = nil;
NSLog(@"t = %p",t); // t = 0x0 

t = [NSDate alloc];
NSLog(@"t = %p",t); // t = 0x100107af0

t = [t init];
NSLog(@"t = %p",t); // t = 0x1001035a0
2 Answers
Related