Re: How do I get the selected cells?
Re: How do I get the selected cells?
- Subject: Re: How do I get the selected cells?
- From: mmalcolm crawford <email@hidden>
- Date: Tue, 2 Nov 2004 15:55:14 -0800
On Nov 2, 2004, at 3:35 PM, Graham Cox wrote:
true, but the larger question was how to record the state of each cell
into another structure for saving.
As part of the bigger question, the state information should almost
certainly not be stored in the user interface...
On Nov 2, 2004, at 2:10 AM, Peter Karlsson wrote:
NSArray *cells = [myMatrixOutlet cells];
NSEnumerator *enumerator = [cells objectEnumerator];
NSCell *aCell;
while (aCell = [enumerator nextObject])
{
if ([aCell state] == YES)
{
bits = [bits stringByAppendingString:@"1"];
}
else
{
bits = [bits stringByAppendingString:@"0"];
}
}
The more conventional approach would be for the matrix to operate
(typically via a controller) on a model object of some description that
captures the information. The contents of that model object should
then be "archived" as appropriate, rather than the state of the matrix.
mmalc
_______________________________________________
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