Re: another releasing related question
Re: another releasing related question
- Subject: Re: another releasing related question
- From: Jim Correia <email@hidden>
- Date: Wed, 18 Apr 2007 12:48:41 -0400
On Apr 18, 2007, at 12:36 AM, Jay wrote:
Consider the following code,
NSValue *A= [NSValue valueWithPoint:B];
NSDictionary *C= [NSDictionary dictionaryWithObject:A forKey: "A"];
[viewNoteCenter postNotificationName:MSG_A object: self userInfo:C];
This is the code I used to send out notifications, THE QUESTION is,
should I release the pointer A? Since I created it at first
You didn't create it.
Please refer to the documentation. +valueWithPoint: isn't one of the
special methods in which you take ownership of the returned object.
From the monthly message posted by the list admin:
Memory management
-----------------
Developers are strongly discouraged from attempting to reformulate
Cocoa's memory management rules in posts to the list. Almost
invariably, someone makes a subtle or not-so-subtle mistake which then
results in confusion and additional messages to resolve the issue.
Simply post links to the relevant documentation, such as:
<http://developer.apple.com/documentation/Cocoa/Conceptual/
MemoryMgmt/Tasks/MemoryManagementRules.html>
Jim
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden