1
開始學習在SWIFT編碼,這個錯誤來了,每次我使用錯誤的方法,請幫助錯誤有錯誤代碼:零/零/錯誤
var context = (UIApplication.sharedApplication().delegate as! AppDelegate).managedObjectContext
var request = NSFetchRequest(entityName: "Pattern")
var results = context.executeFetchRequest(request, error:nil) // Extra argument 'error' in code
if results != nil {
}
}
func createTestPatterns(){
var context = (UIApplication.sharedApplication().delegate as! AppDelegate).managedObjectContext
var pattern = NSEntityDescription.insertNewObjectForEntityForName("Pattern", inManagedObjectContext: context) as! Pattern
pattern.name = "Blue Mushroom"
context.save(nil) //call can throw but it is not marked with 'try' and the error is not handled
}
什麼我應該在這裏做什麼,請幫助。