HavenB3
HavenB3

Reputation: 129

NSFetchedResultsController deleteCache in Swift 3

Currently migrating to swift 3 and can't quite figure out what the parser wants for NSFetchedResultsController.deleteCache(withName: "rootCache")

With this syntax, I'm getting a "Type 'String?' does not conform to protocol 'ExpressibleByStringLiteral'" error when building.

Upvotes: 9

Views: 827

Answers (1)

Martin R
Martin R

Reputation: 539715

The error message is misleading. As of Swift 3, NSFetchedResultsController is a generic type

open class NSFetchedResultsController<ResultType : NSFetchRequestResult> : NSObject { }

and the following should work:

NSFetchedResultsController<NSFetchRequestResult>.deleteCache(withName: "rootCache")

Upvotes: 15

Related Questions