The object is being dealloced but once the object goes to retain count 0 any method calls are likely to return stale values.
If you compile and run on 32 bit, you will get an error (message retainCount sent to freed object=0x...).
I'm guessing the 64bit runtime (default compile option on Leopard) does not collect objects as aggressively as the 32 bit runtime so your call to retainCount does not cause an error.
To check that you object is indeed dealloced, implement dealloc for your SampClass:
- (void) dealloc
{
NSLog(@"Dealloc");
[super dealloc];
}
Later edit: As I suspected, the difference in behavior between 32 and 64 bit when calling a method on a released object is from the runtime and not undefined behavior.
In 32 bit, once a class is freed it's isa pointer is switched to a special class that allows intercepting messages to freed objects. This does not happen in 64 bit.
Relevant source is objc-class.m:
#if !__OBJC2__
// only clobber isa for non-gc
anObject->isa = _objc_getFreedObjectClass ();
#endif