[Solved]RE: How do I get the selected cells?
[Solved]RE: How do I get the selected cells?
- Subject: [Solved]RE: How do I get the selected cells?
- From: "Peter Karlsson" <email@hidden>
- Date: Tue, 2 Nov 2004 11:10:49 +0100
I got it now, here is the code I ended up with. Convert a NSMatrix to a
NSString. Maybe there is better ways, but it works for me.
Peter
NSString *bits = @"";
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"];
}
}
Ursprungligt meddelande
> Dear list!
>
> My NSMatrix have 8 cells from left to right. I am trying to get the
> selected cells. Here is my code so far:
>
> NSArray *cells = [myMatrixOutlet cells];
> NSEnumerator *cellEnum = [cells objectEnumerator];
> NSCell *cell;
> while (cell = [cellEnum nextObject])
> {
>
> What am I supposed to do here to get the selected cells?
>
> }
>
> Best regards Peter
>
> _______________________________________________
> 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
>
_______________________________________________
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