• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: another releasing related question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >another releasing related question (From: "Jay" <email@hidden>)

  • Prev by Date: another releasing related question
  • Next by Date: What is "-fobjc-exceptions" anyway?
  • Previous by thread: another releasing related question
  • Next by thread: Re: another releasing related question
  • Index(es):
    • Date
    • Thread