4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

XCode 6.3にしたら、NSFetchedResultsControllerDelegateが動かなくなった

Posted at

大体のケースでは動くと思うけど、ちょっとした事で動かなかったのでメモ。

もともと、NSFetchedResultsControllerDelegateViewControllerから引きはがしたくて

class FetchedResultsControllerDelegate: NSFetchedResultsControllerDelegate {

}

という感じのクラスを作って、

class ViewController: UIViewController {
    private var fetchedResultsControllerDelegate: FetchedResultsControllerDelegate!

    override func viewDidLoad() {
      fetchedResultsControllerDelegate = FetchedResultsControllerDelegate(tableView)
      
    }
}

みたいにやっていた。

これが、XCode 6.3にしたら動かなくなってしまった。

基本に立ち返って、ViewControllerにNSFetchedResultsControllerDelegateを書くと動く。

なので、

class FetchedResultsControllerDelegate: NSObject, NSFetchedResultsControllerDelegate {

}

としてみたら、ちゃんと動くようになった。

今まで動いていたのが奇跡だったようだ…。

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?