See what beryllium said above ;) Never use -retainCount
That said, there are two issues here:
The first isn't in the autorelease pool, but in your NSLog.
-[NSObject retainCount]
returns an NSUInteger, which is either 32-bits wide or 64-bits wide, depending on the system architecture. It's considered best practice to always cast NSInteger values to (long) and NSUInteger values to (unsigned long) when a function takes a variable number of arguments. Hence:
NSLog(@"%l", (long)[str integerValue]
or
NSLog(@"%lu", (unsigned long)[str retainCount])
The second is an optimization: @"This is string object" is actually an NSString by itself, but a special NSString called a NSCFConstantString, which has a retain count of NSIntegerMax (meaning that they cannot be dealloc'd).
I just ran your original example, and it looks like an NSString initialized via -initWithString:
returns the original string. In this case, that's the constant string, so it's returning NSIntegerMax.