I have a ViewController whose view results from data from a fetch request with Predicate 1. I’d like to repeat the fetch request with a more restrictive Predicate 2 that will give a SUBSET of the data using Predicate 1.
Then I’d like to update (and possibly animate) that view on the iPhone screen by pressing a toggle button, so that the old and new views expand and collapse the rows. (I don’t want to do this modally, as I’d like the user to see which rows came from the old rows.)
I’m thinking of something like the Phone application on the iPhone. Under the “Recents” tab, you’ll see “All” and “Missed” buttons. When you press these buttons, it switches between showing all calls and just the missed ones by expanding/collapsing the rows. As far as I can tell, this is not a modal transition.
Can someone give me pointers as to how to do this?
If your view is a
UITableView, you can use a combination ofand
as well as the corresponding
-insertmethods, if applicable. You can batch multiple changes (so they animate at the same time) with-beginUpdatesand-endUpdates.I’m not aware of any way you’ll be able to do this that doesn’t involve iterating over one of the two sets and repeatedly calling
-indexForObjecton the other, though.