FROM : Peter Karlsson
DATE : Tue Nov 02 11:10:49 2004
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_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>
> This email sent to <email_removed>
>
DATE : Tue Nov 02 11:10:49 2004
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_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>
> This email sent to <email_removed>
>
| Related mails | Author | Date |
|---|---|---|
| No related mails found. | ||






Cocoa mail archive

