Re: cocoa-dev digest, Vol 2 #1032 - 16 msgs
Re: cocoa-dev digest, Vol 2 #1032 - 16 msgs
- Subject: Re: cocoa-dev digest, Vol 2 #1032 - 16 msgs
- From: Raff <email@hidden>
- Date: Thu, 1 Aug 2002 12:46:00 +0200
From: "Chong Hiu Pun" <email@hidden>
To: "Sylvain Leroux" <email@hidden>
Cc: <email@hidden>
Subject: Re: on NSString usage
Date: Thu, 1 Aug 2002 16:46:28 +0800
1.)But strResult pointed to 3 different objects:
strResult ----> aaa, and then
strResult ----> bbb
will the system release the memory space of "aaa"? Otherwise memory
leak may
occur!
You receive it, you do not allocate it, so, as it is not part of a
collection, it is by default autoreleased.
What you need is to define accessor methods to take it and retain it
yourself (otherwise it will be lost after the end of the event loop).
You should entirely read and apply what you will find in the 'Memory
allocation questions' and 'More memory allocation questions' threads of
this mailing list (and the documents concerned).
It begins on the 28th july, 6h55.
2.) So a global NSString will just release after the application quit?
Do read all that !
_______________________________________________
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.