Re: MutableArrays losing its contents?
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.