Hi. The simplest code ever in Objective-C causes weird behavior:
#import Foundation/Foundation.h>
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSObject *obj = [[NSObject alloc] init];
NSLog(@"retain count %d",[obj retainCount]);//print 1
[obj release];//obj deallocated
NSLog(@"retain count %d",[obj retainCount]); //still printing 1 in Snow Leopard! Why??
[pool drain];
return 0;
}
The 2nd NSLog should print "message retainCount sent to freed object=0x103eb0". If you use Leopard everything works fine, but in Snow Leopard the 2nd NSLog still prints 1. Is there any bug i XCode delivered for Snow Leopard?? Thanks