Welcome, Guest
Username Password: Remember me

SCTableViewModelDelegate Method Request
(1 viewing) (1) Guest
  • Page:
  • 1
  • 2

TOPIC: SCTableViewModelDelegate Method Request

SCTableViewModelDelegate Method Request 1 year, 7 months ago #1

SCTableViewModelDelegate has:

- tableViewModel:willRemoveRowAtIndexPath:

but, can we get:

- tableViewModel:didRemoveRowAtIndexPath:
  • icyplains
  • OFFLINE
  • Expert Boarder
  • Posts: 133
  • Karma: 5

Re: SCTableViewModelDelegate Method Request 1 year, 7 months ago #2

Sure, will do! Thanks for your feedback Tommy
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72

Re: SCTableViewModelDelegate Method Request 1 year, 7 months ago #3

Yes! And also I wonder if STV could implement its own version of an existing UITableView delegate method:
(void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
as this will help with a feature I'm build to make user-reordering of an arrayOfObjects section (created by STV automatically from an ArrayOfObjectCell selection) sticky. These all would be terrific.
  • Geoffrey
  • OFFLINE
  • Senior Boarder
  • Posts: 48
  • Karma: 3

Re: SCTableViewModelDelegate Method Request 1 year, 7 months ago #4

Hi Geoffrey,

Please note that SCArrayOfObjectsCell/SCArrayOfObjectSection automatically persists row movement by reordering the actual objects in the "items" array provided to SCArrayOfObjectsCell/SCArrayOfObjectsSection. You do not need to handle this yourself. This is exactly how the classes also handle row deletion by automatically deleting the associated item in the "items" array. Is this what you're after?
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72

Re: SCTableViewModelDelegate Method Request 1 year, 7 months ago #5

My objects are bound to Core Data so the user re-ordering is wiped clean each time the view is pushed again. Or is there a way to handle this in STV already?

The updated ordering also has to be written to each objects attribute "displayOrder" for use in other parts of the application, so I need to get the newly ordered array after the user reorders at the very least to walk through the objects and update the attribute. But I do want the reordering sticky for display as well.
  • Geoffrey
  • OFFLINE
  • Senior Boarder
  • Posts: 48
  • Karma: 3
Last Edit: 1 year, 7 months ago by Geoffrey.

Re: SCTableViewModelDelegate Method Request 1 year, 7 months ago #6

Core Data objects are actually stored in an NSSet, not an NSArray, and that's why they cannot be ordered (if you notice, Apple's Core Data templates always disable row movement).

How are you planning to persist the cell order if you were to do that manually?
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72
  • Page:
  • 1
  • 2
Time to create page: 0.88 seconds