Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Inserts and deletes sync with FRC #18

Merged
merged 1 commit into from
May 18, 2015
Merged

Conversation

rnystrom
Copy link
Contributor

There was an issue where the row data would easily get out of sync with the real rows when inserting and deleting. Using NSFetchedResultsController made this super obvious.

Huge thanks to @LindyLo for the sample project with a reproduced issue!

fixes #16

There was an issue where the row data would easily get out of sync with the real rows when inserting and deleting. Using `NSFetchedResultsController` made this super obvious.

Huge thanks to @LindyLo for the sample project with a reproduced issue!

fixes #16
@bassrock
Copy link
Contributor

👍 !!!!

rnystrom added a commit that referenced this pull request May 18, 2015
@rnystrom rnystrom merged commit e6cb792 into master May 18, 2015
@bassrock
Copy link
Contributor

I am not sure this is completely fixed.

I am using this with a sorted NSFetchedResults Controller and still get the bug from #16. When I print the index rows from the Insert case it prints as follows:

25
5
12
22
28
4
31
2
29
7
8
26
23
32
19
0
21
11
35
1
17
6
3
20
36
15
9
14
30
16
13
34
27
10
18
24
33

As you see it prints out of order, which is why we get an out of bounds error still. My guess is the tableView.beginUpdates and tableView.endUpdates most likely handle this situation and do not cause issues in UIKit, but these do not exist in WatchKit.

@rnystrom rnystrom deleted the insert-delete-with-FRC branch May 27, 2015 17:45
@rnystrom
Copy link
Contributor Author

I think once I get the unit test abstractions working better we'll be able to zero in on what's going on here. Ya it's difficult to get both the NSFRC API and this working in tandem since WKInterfaceTable seems to immediately take action as opposed to UITableView's commit/transaction API.

@bassrock
Copy link
Contributor

yea, well actually my update fixes this. Forgot to mention that ;)

@rnystrom
Copy link
Contributor Author

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants