Button cell state: outlet works, cellWithTag: doesn't
Button cell state: outlet works, cellWithTag: doesn't
- Subject: Button cell state: outlet works, cellWithTag: doesn't
- From: Jonathan Jackel <email@hidden>
- Date: Sat, 14 Jun 2003 10:34:52 -0400
I've actually solved this problem, but I don't know why I had a problem
in the first place.
I'm trying to control the state of an on/off button cell in a matrix.
The user can turn it on or off explicitly by clicking on it. When
certain other things happen, I want the button cell to be turned off by
my app.
If I refer to the cell by its tag, i.e. [theMatrix cellWithTag:23], it
always reports that its state is 0, or off, even when it is on.
Calling setState: on this cell has no effect. I checked the tag number
about 100 times, and other parts of the program that depend on
referring to the cell by its tag number work correctly.
If I instead set up an outlet to an NSButtonCell, and connect that
outlet to the cell I am interested in, it all works as expected. The
cell reports that its state is on or off as appropriate, and I can
change the state by calling setState:.
Is there a reasonable explanation for this? Why would an outlet work
when cellWithTag doesn't?
Jonathan
_______________________________________________
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.