Skip navigation.
 
mlRe: Table and checkboxes..
FROM : stephane sudre
DATE : Tue Oct 12 19:16:35 2004

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.

Related mailsAuthorDate
mlTable and checkboxes.. Martha Espinosa Oct 12, 19:04
mlRe: Table and checkboxes.. stephane sudre Oct 12, 19:16