我现在更新我的Xcode我有Xcode 7,当它转换我的代码时我有这个NSError问题,知道如何修复它吗?
if let managedObjectContext = (UIApplication.sharedApplication().delegate as? AppDelegate)?.managedObjectContext {
restaurant = NSEntityDescription.insertNewObjectForEntityForName("Restaurant", inManagedObjectContext: managedObjectContext) as! Restaurant
restaurant.name = nameTextField.text
restaurant.type = typeTextFiedl.text
restaurant.location = locationTextField.text
restaurant.image = UIImagePNGRepresentation(imageView.image!)
restaurant.isVisited = isVisted
//restaurant.isVisited = NSNumber.convertFromBooleanLiteral(isVisited)
var e: NSError?
if managedObjectContext.save(&e) != true {
print("insert error: \(e!.localizedDescription)")
return
}
}