Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSFetchRequest setFetchOffset in NSFetchedResultsController

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.

like image 803
Matt Andersen Avatar asked Feb 24 '26 22:02

Matt Andersen


1 Answers

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

like image 55
Matt Andersen Avatar answered Feb 27 '26 12:02

Matt Andersen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!