0
私はViewController
にピッカーを持っており、その結果はラベルに印刷されます。ここでUILabelの結果をCoreDataに保存
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
mlabel.text= [arrayNo objectAtIndex:row];
}
コアにラベルの結果を保存コードです:私は、エラーコードここで
"[<__NSCFConstantString 0xf488> valueForUndefinedKey:]: this class is not key value coding-compliant for the key attribute.'.
を取得し、CoreData
にこれらの結果を保存中に問題が生じていますラベルを出力コードがありますデータ:
- (IBAction)editSaveButtonPressed:(id)sender
{
if (!currentCategory)
self.currentCategory = (Entity *)[NSEntityDescription insertNewObjectForEntityForName:@"Entity" inManagedObjectContext:self.managedObjectContext];
[self.currentCategory setAttribute:[mlabel text]]; //This is the line causing the error
NSError *error;
if (![self.managedObjectContext save:&error])
NSLog(@"Failed to add new category with error: %@", [error domain]);
[self.navigationController popViewControllerAnimated:YES];
}
なぜこのエラーが発生しますか?入力いただきありがとうございます。
感謝を。私は実際にチュートリアルをチェックしています。これはプロトコルやデリゲートについてのものです。 – PopUp