开发者

Why is fetchedResultsController set to nil?

开发者 https://www.devze.com 2023-03-19 18:53 出处:网络
Why is this in the FetchedResultsController code开发者_JAVA技巧 that Apple gives us? if (fetchedResultsController != nil) {

Why is this in the FetchedResultsController code开发者_JAVA技巧 that Apple gives us?

if (fetchedResultsController != nil) {
    return fetchedResultsController;
}


This is because they only need to set up the fetchedResultsController once.

Below that statement there is a load of set up to initialise fetchedResultsController.

So the first time you hit the method by calling fetchedResultsController the ivar is set up then any subsequent calls to fetchedResultsController simply return the already set up ivar.

0

精彩评论

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