XCode not releasing nsstring
XCode not releasing nsstring
- Subject: XCode not releasing nsstring
- From: Justin Lundy <email@hidden>
- Date: Tue, 11 Nov 2003 17:20:15 -0800
I threw this into a new project:
NSString *releaseTest;
if (releaseTest != nil) NSLog(@"A: releaseTest NOT nil.");
if (releaseTest == nil) NSLog(@"A: releaseTest nil.");
releaseTest = [[NSString alloc] initWithString:@"test string"];
if (releaseTest != nil) NSLog(@"B: releaseTest NOT nil.");
if (releaseTest == nil) NSLog(@"B: releaseTest nil.");
[releaseTest release];
if (releaseTest != nil) NSLog(@"C: releaseTest NOT nil.");
if (releaseTest == nil) NSLog(@"C: releaseTest nil.");
and guess what the log said?
A: releaseTest nil.
B: releaseTest NOT nil.
C: releaseTest NOT nil.
Call me crazy, but shouldn't the last one say "C: releaseTest nil."?
Bug?
Help?
---
Box O' Rox Software
www.boxorox.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.