• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Table and checkboxes..
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Table and checkboxes.. (From: Martha Espinosa <email@hidden>)

  • Prev by Date: Re: Find the 'Application Support' folder
  • Next by Date: Re: Find the 'Application Support' folder
  • Previous by thread: Table and checkboxes..
  • Next by thread: Preventing windows from loading on addWindowController
  • Index(es):
    • Date
    • Thread