开发者

Why is fetchedResultsController set to 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜