开发者

Does it make sense to use a NSFetchedResultsController without an UITableViewController? How are they related?

开发者 https://www.devze.com 2023-01-03 15:05 出处:网络
I mean... could I also just create a plain old UIViewController and then set up a UITableView myself, plus an NSFetchedResultsController?

I mean... could I also just create a plain old UIViewController and then set up a UITableView myself, plus an NSFetchedResultsController?

How much do UITableViewController and NSFetchedResultsController interact with eachother? As far as I see开发者_JS百科 it, UITableViewController is NOT by default already adopting the NSFetchedResultsControllerDelegate protocol. It almost looks like if UITableViewController has been developed without knowing about NSFetchedResultsController. Probably they even did that before developing FRC. Anyways, just a raw guess because the UITableViewController lacks of mentioning FRC at all.

So the only thing I see in UITableViewController is that it is already the delegate for a UITableView by adopting the protocol, and it sets up the UITableView instance for me and assigns it internally to it's tableView property. Is that the whole magic of UITableViewController?

(note: the nsfetchedresultscontrolle tag is not a typo. SO has a limit for the num of chars...too bad for that missing r, that's why I avoided this tag in my other buch of questions like the plague)


Yes, you can do that. Your view controller is not required to subclass UITableViewController. However, NSFetchedResultsController is designed to go with a table view. If your UI does not have a table view at all then a NSFetchedResultsController is probably the wrong answer.

0

精彩评论

暂无评论...
验证码 换一张
取 消