FROM : Peter Karlsson
DATE : Wed Nov 03 08:25:26 2004
Well, it works for me and I'm happy with that. I'm pretty sure my way is
not the ultimate way. but I'm just a newbee so it takes some time to learn.
Thanks to all that helped me out with this.
Peter
Ursprungligt meddelande
>
> 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_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>
> This email sent to <email_removed>
>
DATE : Wed Nov 03 08:25:26 2004
Well, it works for me and I'm happy with that. I'm pretty sure my way is
not the ultimate way. but I'm just a newbee so it takes some time to learn.
Thanks to all that helped me out with this.
Peter
Ursprungligt meddelande
>
> 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_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

