• 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
object Allocation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

object Allocation


  • Subject: object Allocation
  • From: Jerrod Fowkes <email@hidden>
  • Date: Wed, 19 Apr 2006 13:06:36 -0700 (PDT)

Hello,

I have a question about object allocation. I noticed that to code:

NSDictionary* dict;

dict = [NSDictionary dictionaryWithDictionary: object];
[dict release];


creates problems later on in code. I think it has something to do with the autoReleasePool. not sure.  My question is, when the class method gets called, it doesn't actually allocate the object 'dict'?

I noticed that :

dict = [[NSDictionary alloc] initWithDictionary: object];
 [dict release];

doesn't crash the program.

Could someone enlighten me on this? -Jerrod Fowkes


---------------------------------
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls.  Great rates starting at 1&cent;/min.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: object Allocation
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: NSDistributedLock question
  • Next by Date: Implementation across several files
  • Previous by thread: Re: NSDistributedLock question
  • Next by thread: Re: object Allocation
  • Index(es):
    • Date
    • Thread