Re: newbie memory question
Re: newbie memory question
- Subject: Re: newbie memory question
- From: Chris Hanson <email@hidden>
- Date: Mon, 1 Dec 2003 13:16:25 -0600
On Dec 1, 2003, at 4:06 AM, M. Uli Kusterer wrote:
At 18:25 Uhr -0600 30.11.2003, Chris Hanson wrote:
The memory management rules are pretty clear on what all o the above
is.
NSData *data = [[notice userInfo] objectForKey:
NSFileHandleNotificationDataItem];
This gets a value from the dictionary. There's no use of +alloc or
-copy so you have to assume you don't own the object and it's
autoreleased. If you want to own it you have to retain or copy it.
Actually, this is *not* autoreleased. It is owned by the dictionary.
Which means as soon as the dictionary goes away, this object may
disappear as well.
I didn't say it was autoreleased, I said you had to assume it was. So
if you want to own it you have to retain or copy it, otherwise it will
go away whenever its owner does.
A little bit of a nitpick, I know.
-- Chris
--
Chris Hanson <email@hidden>
bDistributed.com, Inc.
Outsourcing Vendor Evaluation
Custom Mac OS X Development
Cocoa Developer Training
_______________________________________________
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.