当我尝试访问CoreData中的作者项时,我收到EXC_BAD_ACCESS错误。
当我尝试访问author.authorName
时,我遇到了错误func setupAuthorList(){
var error: NSError?
let request = NSFetchRequest(entityName: "AuthorList")
let results = self.context!.executeFetchRequest(request, error: &error) as! [AuthorList]
if let _error = error {
println("\(_error.localizedDescription)")
} else {
for author in results {
println("\(author.authorName)")
}
}
self.authorLabel.text = author!.authorName
let urlString = author!.authorImage
let url = NSURL(string: urlString)
self.avatarImageView.layer.cornerRadius = self.avatarImageView.frame.size.width/2
self.avatarImageView.clipsToBounds = true
self.avatarImageView.hnk_setImageFromURL(url!)
self.newspaperLabel.text = author!.newspaperName
}