In the book it is explained that when we change __weak attribute of container member to __unsafe_unretained, the statements
backpack = nil;
NSLog("@Container: %@", [calculator container]);
cause application to crash. That’s perfectly understandable - [calculator container] returns a pointer to an object that does not exists anymore, NSLog calls description method of that object that causes crash.
What I don’t understand is if I rewrite NSLog just to output the pointer value, in my understanding nothing wrong should happen - it should simply print the address of now invalid object but it’s OK. What happens, the program still crashes - why? NSLog does not need to call any method of that object in this case - it suppose only to print its address:
backpack = nil; NSLog(@"Container: %p", [calculator container]);