• 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
another releasing related question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

another releasing related question


  • Subject: another releasing related question
  • From: "Jay" <email@hidden>
  • Date: Wed, 18 Apr 2007 12:36:11 +0800

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,  and according to the reference for NSDictionary, each object added to the dictionary receives a "retain" message, in order to prevent it from deallocated before the dictionary is through with it. In this way, should I release it or just leave it alone?

regards,
Jay
_______________________________________________

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

  • Follow-Ups:
    • Re: another releasing related question
      • From: "I. Savant" <email@hidden>
    • Re: another releasing related question
      • From: Jim Correia <email@hidden>
  • Prev by Date: Re: PNG in the pasteboard
  • Next by Date: Re: another releasing related question
  • Previous by thread: Re: About NSEnumerator
  • Next by thread: Re: another releasing related question
  • Index(es):
    • Date
    • Thread