• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: XCode not releasing nsstring
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XCode not releasing nsstring


  • Subject: Re: XCode not releasing nsstring
  • From: James Spencer <email@hidden>
  • Date: Tue, 11 Nov 2003 21:12:06 -0600

On Nov 11, 2003, at 7:20 PM, Justin Lundy wrote:

[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."?


Your test doesn't test whether the object has been released; it tests whether the variable release test is nil. It's not; it still contains the pointer to the old (no longer valid) NSString. Try sending a message to the released object and you should get an error back.

James P. Spencer
Rochester, MN

email@hidden

"Badges?? We don't need no stinkin badges!"
_______________________________________________
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.

  • Follow-Ups:
    • Re: XCode not releasing nsstring
      • From: Oleg Svirgstin <email@hidden>
References: 
 >XCode not releasing nsstring (From: Justin Lundy <email@hidden>)

  • Prev by Date: Fwd: XCode not releasing nsstring
  • Next by Date: Preventing tableView sorting
  • Previous by thread: Re: XCode not releasing nsstring
  • Next by thread: Re: XCode not releasing nsstring
  • Index(es):
    • Date
    • Thread