Changing the Sorting in an NSFetchedResultsController on the fly

后端 未结 4 995
执笔经年
执笔经年 2020-12-25 14:34

I\'m trying to change the sorting in a NSFetchController on the fly, by some sort of segmented control. To either sort A->Z Z->A type thing.

What do I have to do to

4条回答
  •  感动是毒
    2020-12-25 15:11

    fetchRequest is a read-only property. The line of code in your post will not work. If you want to use a different fetch request, you'll need to replace your controller with a new NSFetchedResultsController. Your table won't reload automatically. You'll need to send it a reloadData message some time after you've replaced the NSFetchedResultsController.

提交回复
热议问题