views:

24

answers:

1

In my application I add objects directly to an ArrayController. When I want to clean all items I do:

[[downloadItemsController content] removeAllObjects];

This command however does not refresh the TableView the arraycontroller is bound to. If I remove all items and add another new items I only see that item. That is fine but if I don't add anything I still have all my items in the table.

If I do

[downloadItemsController prepareContent];

all old items are removed from the tableview but than I will get an new and empty item I can edit. I don't want that and because one of my columns has a checkboxcell I always get an row with a checkbox.

I just need an empty table with no items after I remove all existing items.

A: 

This is because you're modifying the controller's content "behind its back." Try using the array controller's -removeObjects: method.

Joshua Nozzi