• 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: Shawn Erickson <email@hidden>
  • Date: Tue, 11 Nov 2003 20:25:47 -0800

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

[releaseTest release];

Others have pointed out the issue but it points to a fundamental misunderstanding on what the above means.

In Objective-C the above implies that a "release" message will be sent to the object referenced by the variable "releaseTest". The object receiving the message has no way to access or modify the variable releaseTest, it doesn't know the address of the variable being used.

If you understand C the following may help... the Objective-C compiler turns the above into a simple C function call like the following. Note that it passed in releaseTest not the address of releaseTest so the method does not have the ability to adjust the variable.

objc_msgSend(releaseTest, "release");

For more info...
http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/ 3objc_language_overview/chapter_3_section_6.html#//apple_ref/doc/uid/ 20001424/BAJHIAGB

-Shawn
_______________________________________________
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.

References: 
 >XCode not releasing nsstring (From: Justin Lundy <email@hidden>)

  • Prev by Date: Re: Correct way to get a person in Address Book
  • Next by Date: Xcode / Interface Builder Bug?
  • Previous by thread: Re: XCode not releasing nsstring
  • Next by thread: Fwd: XCode not releasing nsstring
  • Index(es):
    • Date
    • Thread