的滴度說明錯誤:不可接受類型的值 - 期望類型的NSString
Unacceptable type of value for attribute: property = "routinename"; desired type = NSString; given type = _NSArrayM;
我加入從該用戶產生一個陣列並將其導入核心數據實體。
viewDidLoad中
NSMutableArray *array = [[NSMutableArray alloc] init];
self.exTitle = array;
didSelectRowAtIndexPath方法
[self.exTitle addObject: info.name];
這一切工作正常,並增加值到數組:
這是通過。
將其添加到我試過核心數據實體:
-(IBAction) Done: (id)sender {
NSManagedObjectContext *context = [self managedObjectContext];
NSManagedObject *newDevice = [NSEntityDescription insertNewObjectForEntityForName:@"Routines" inManagedObjectContext: context];
[newDevice setValue:exTitle forKey: @"routinename"];
我可能失去了一些東西很簡單,但我怎麼改正這個,所以我可以在陣列添加到在實體NSString的格式化值。
如何(爲什麼)做你想將數組轉換爲字符串? – Wain
注意:該屬性是否叫做「exTite」,「exTitle」或「extTitle」?不知何故,這讓我懷疑你粘貼了你的真實代碼... –
@ Martin R ....我不得不從我的其他計算機輸入代碼,因爲此刻我沒有互聯網接入,而且我的加密狗不工作在我的mac所以我需要使用我的電腦... – memyselfandmyiphone