Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core Data compatible #24

Open
Sun3 opened this issue Apr 15, 2014 · 2 comments
Open

Core Data compatible #24

Sun3 opened this issue Apr 15, 2014 · 2 comments

Comments

@Sun3
Copy link

Sun3 commented Apr 15, 2014

I am trying to using the wonderful control with a UITableViewController bound to a Core Data source but one I release the drag the row always goes back immediately to original position?

Is this control compatible with Core Data, is there possible sample code?

Thank you

@mluisbrown
Copy link
Contributor

BVReorderTableView is totally compatible with Core Data. I'm using them together in my app ThenDo (free). When you say your UITableViewController is "bound do a Core Data source" do you mean you're using NSFetchedResultsController?

You need to remember that if you're reordering your items by dragging them around, you'll also have to change whatever attribute of your object Core Data is using to order them, which may mean changing the order attribute of more than just the item you moved. It's not difficult, but you need to think about it.

@Sun3
Copy link
Author

Sun3 commented Apr 17, 2014

@mluisbrown Yes, I am using NSFetchedResultsController The example project is using NSArray in the delegates and I am trying to figure out what to use since my data is not from an array.

For example what would I use below if I am using core data?

- (id)saveObjectAndInsertBlankRowAtIndexPath:(NSIndexPath *)indexPath {  
    id object = [_objects objectAtIndex:indexPath.row];
    [_objects replaceObjectAtIndex:indexPath.row withObject:@"DUMMY"];
    return object;
}

Any help is appreciated :)

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants