Reputation: 4816
I'd like to know if I should expect setFetchOffset to work in an NSFetchedResultsController.
Given a UITableView that displays rows like this from an NSFRC:
1
2
3
4
5
I expected that adding this line:
[fetchRequest setFetchOffset:1];
e.g. line 207 here: http://github.com/mandersen/FetchOffsetCase/blob/master/Classes/RootViewController.m
Would result in UITableView rows like:
2
3
4
5
But it doesn't change the values displayed in the table.
Upvotes: 3
Views: 1768
Reputation: 4816
setFetchOffset only works on persisted entities.
I figured this out while experiencing similar frustrations with NSFetchRequest setReturnsDistinctResults and found Michael Waterfall's question on that subject:
NSDictionaryResultType expression not taking into account newly inserted objects
Upvotes: 2
Reputation: 46718
WHen you say you expect 2, 3, 4, 5 what do you mean? If you are expecting the index to be offset then that is incorrect. What it will do is grab the 2nd through 6th results returned by the NSFetchRequest
.
Upvotes: 0