Re: Table and checkboxes..
Re: Table and checkboxes..
- Subject: Re: Table and checkboxes..
- From: stephane sudre <email@hidden>
- Date: Tue, 12 Oct 2004 19:16:35 +0200
On Oct 12, 2004, at 7:04 PM, Martha Espinosa wrote:
Hi,
I have a table that consists of a column of checkboxes and a column
named "Result" of data (lets say YES, NO)
What I want to do is check which checkbox is checked on and grab the
YES or NO from the "Result" column and insert that into an array...
Right now my code grabs the result and places it in the first element
of the array...
if ([NSNumber numberWithInt:1]) {
NSArray *yesSir =[d objectForKey:@"Result"]
NSLog(@"Checkbox ON=%@", yesSir);
}
Any help or suggestions is appreciated... I hope this makes sense...
Hum, how do you keep the correct state of the checkboxes if you do not
already have a model with this information?
The tableview is the view. You need to work with the model on this one.
Usually, a tableview is the view for a NSArray. In your case, you
could have a NSArray of NSDictionary with 2 keys: A NSNumber * which
represents the state of the checkbox, a NSString * which represents
your result.
So at the end, you just have to enumerate your NSArray and find the
rows with a NSNumber set to YES in the NSDictionary.
_______________________________________________
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