Re: XCode not releasing nsstring
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.