• 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: MutableArrays losing its contents?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MutableArrays losing its contents?


  • Subject: Re: MutableArrays losing its contents?
  • From: Clark Cox <email@hidden>
  • Date: Mon, 1 Dec 2003 22:22:30 -0500

On Dec 01, 2003, at 21:54, Lee Morgan wrote:

> On Dec 1, 2003, at 9:20 PM, Lee Morgan wrote:
>
>> Well, your exactly right - I did some extra check and the array I'm
>> adding into is getting and keeping its contents its just for some
>> reason I'm getting a second instance of the SAME array in the other
>> method. But I have no idea why this is happening... My array is
>> global to the class and I only alloc and init it one time in my
>> initWithFrame method.


Just got (what I hope is) a flash of insight.

By "global to the class", do you mean that it is not an instance
variable, but it defined in the implementation file?
Do you create multiple instances of your view class? If so, then
initWithFrame will be called for each instance, and each time it is
called, a new array will be created, and it will be assigned to your
"global" variable, thereby overwriting it's previous value.

--
Clark S. Cox III
email@hidden
http://homepage.mac.com/clarkcox3/blog/B1196589870/index.html

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: MutableArrays losing its contents?
      • From: Lee Morgan <email@hidden>
References: 
 >Re: MutableArrays losing its contents? (From: Lee Morgan <email@hidden>)
 >Re: MutableArrays losing its contents? (From: Clark Cox <email@hidden>)
 >Re: MutableArrays losing its contents? (From: Lee Morgan <email@hidden>)
 >Re: MutableArrays losing its contents? (From: Lee Morgan <email@hidden>)

  • Prev by Date: Re: dumb button/textfield question
  • Next by Date: Re: rounding a float
  • Previous by thread: Re: MutableArrays losing its contents?
  • Next by thread: Re: MutableArrays losing its contents?
  • Index(es):
    • Date
    • Thread