Re: MutableArrays losing its contents?
Re: MutableArrays losing its contents?
- Subject: Re: MutableArrays losing its contents?
- From: Lee Morgan <email@hidden>
- Date: Tue, 2 Dec 2003 03:40:27 -0500
On Dec 1, 2003, at 10:22 PM, Clark Cox wrote:
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.
Well I found it out thinks in part to you pointing that ... obvious to
anyone but me before fact ;-) ... I have a instance of the view and
then also the view itself (only use one) inside a window. Well I was
using the array within the view of the window but in IB linking the
import method to the instance of it instead so from what I gather the
instance of it and the view within the window - while derived from the
same class are not treated as the same object - which would be why I
was getting two different arrays...
I have since linked the import method (correctly?) to the view within
the window and it works fine now.
Is it bad practice to link actions to the instances of the classes in
IB or (more likely) was I just using it wrong?
Thanks so much again for all the great help and advice.
Lee Morgan
_______________________________________________
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.