This my snippet:
Foo *myFooOne = [[Foo alloc] initWithName:@"my string"];
Foo *myFooTwo = myFooOne;
[myFooOne release];
NSLog(@"Name: %@", myFooTwo.name);
why myFooTwo.name produce correctly output, instead of a runtime error ?
2011-10-28 14:45:10.718 Example[6410:f803] Name: my string
thanks.
You are just lucky that the released memory hasn’t been reused for something else and been overwritten. Otherwise, it would fail.
Run you app with NSZombieEnabled set to YES and it should raise an error at run-time.