Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

trojanvillage

macrumors member
Original poster
Jan 1, 2008
49
0
Toronto
Hello All,
I'm looking for the best way to implement what I'm sure is an easy thing to do.
I have a table view with each cell representing a variable. When you click each cell, it will show a checkmark and save somewhere that it has been checked with a boolean value. In another view, I want the check marked variables to be listed as a string, or some related way. This new view would check to see what variables Boolean is updated every time it redraws.

So, how do I go about doing this, and is there an easier way than what I have planned in my head?

Thanks you for your Help,

Wes.
 
If possible, can I / how do I do this with a .plist? Can I simply send the plist a message to toggle the boolean YES/NO and then have the other view read the plist?
 
Build a model controller to contain the state of your variable(s). Call Boolean getters & setters in that model controller from the handlers for the checkbox view initialization and action delegates.

You then could also do a getter from that model than returns a string object, and call that string getter from wherever you want to display a string representation in a view.

I think this falls under the MVC paradigm.

Me, I would just use a global, less lines of coding:
BOOL foo;
extern BOOL foo;
foo = YES;
myString = foo ? @"YES" : @"NO" ;
 
do u know of a good resource that has a detailed example? Also, does anyone know where I can get a good example of using plists for updating variables.

thanks
 
First, what's the strong desire to use plists? What are you hoping it'll do that other solutions won't?

Second, the usual approach for a tableview is to have an array of objects as the data-source for the table. Depending on your needs, often you'll create a new class to model this object, and then you can add your checkmark boolean as a property of this class.
 
First, what's the strong desire to use plists? What are you hoping it'll do that other solutions won't?

Second, the usual approach for a tableview is to have an array of objects as the data-source for the table. Depending on your needs, often you'll create a new class to model this object, and then you can add your checkmark boolean as a property of this class.

I see what you're saying, can you give me some example code showing the checkmark boolean property?

thanks for your help!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.