views:

253

answers:

1

My App Uses Coredata and Displays Data in a table, one column has a checkbox and one has the title. What i want it to do is that when the checkbox gets checked it deletes the row instead of people having using the Remove/Minus button. The reason I want this is because my app is a Task Management app.

+4  A: 

That sounds like a bad user interface design. One stray click, and the task is gone. What you should do is have the checkbox set a "completed" flag, and then your view can either display that task differently (such as with text strikethrough or grayed out) or provide the user the option of not displaying entries with the flag set.

Hey, that's a good idea, how would i make the rows background color change if the check box is ticked?
Joshua
Off the top of my head, I don't know. I would start by binding the editable or enabled properties of the text cells to the completed flag. If that doesn't give a visual indication, then you can probably bind the text color to the completed flag using a value transformer. Based on a quick look in IB, you probably can't bind the color itself, so you would have to maintain that using KVO.
You could easily have a predicate on the array so that it only displays those without the completed attribute set.
Matthew Schinckel
Could anyone tell me the code to make the table row go slightly opaque when the check box is checked?
Joshua