Reputation: 1347
I am getting "Class 'FavArticleTableViewCell' has no initializers" error for my tableviewcell.
I have several Custom TableViewCells, this the only one I get this error.
import UIKit
import CoreData
class FavArticleTableViewCell: UITableViewCell {
@IBOutlet weak var avatarImageView: UIImageView!
var context: NSManagedObjectContext? {
get {
let appDel = UIApplication.sharedApplication().delegate as! AppDelegate
let _context = appDel.managedObjectContext
return _context
}
}
var article:Article {
didSet{
self.setupFavArticle()
}
}
func setupFavArticle(){
}
}
Upvotes: 0
Views: 320
Reputation: 10479
You have a named article
variable that does not have default value. But all variables must have an initialized value in Swift except Optional.
Declare the article
as Optional will remove the error:
var article:Article? {
didSet{
self.setupFavArticle()
}
}
Upvotes: 1