Re: trivial question
Re: trivial question
- Subject: Re: trivial question
- From: Fritz Anderson <email@hidden>
- Date: Fri, 20 Jun 2003 15:51:27 -0500
On Thursday, June 19, 2003, at 07:36 PM, Nick Hristov wrote:
When I send a messages to NSDictionary, allKeys and allValues, do I
get an autoreleased object, with ref. count. 1 (i.e. it is not a
temporary object)?
You will get an autoreleased object, which means its reference count
will decrease by one when the current autorelease pool is released
(when the current execution thread returns to the run loop). Assuming
that NSDictionary creates the allKeys and allValues return arrays new,
with each response to those messages (and doesn't cache the arrays, for
instance), yes, the reference count will be 1 when you get the array.
But the exact value of the reference count is an implementation detail
you shouldn't have to worry about. All that concerns you is that if you
want to keep the references to the arrays returned by allKeys and
allValues, you will have to retain them as soon as you get them.
-- F
--
Fritz Anderson - Consulting Programmer - Chicago, IL
Mail: <email@hidden>
Risumi: <
http://resume.manoverboard.org>
_______________________________________________
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.