• 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: Newbie problem with NSMutableArray
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie problem with NSMutableArray


  • Subject: Re: Newbie problem with NSMutableArray
  • From: David Emme <email@hidden>
  • Date: Wed, 6 Sep 2006 12:54:35 -0700


On Sep 6, 2006, at 12:14 PM, Marcus Pedersén wrote:

I init my array in init message: myMutArray = [NSMutableArray arrayWithCapacity:1]

Your myMutArray is not retained by anybody, and is likely to disappear at any time. Check the documentation regarding the conventions about which object creation method names give you a retained object and which ones don't.


Meanwhile, see if this doesn't solve your immediate problem (and make sure you understand why it does):

myMutArray = [[NSMutableArray arrayWithCapacity:1] retain];

-Dave

--
Information is a measure of how surprised you are by the next bit.
      -Robert McHenry




Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

References: 
 >Newbie problem with NSMutableArray (From: Marcus Pedersén <email@hidden>)

  • Prev by Date: Screen device name?
  • Next by Date: Re: Help Linking To A Framework
  • Previous by thread: Re: Newbie problem with NSMutableArray
  • Next by thread: Screen device name?
  • Index(es):
    • Date
    • Thread