Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/107.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 在类型为';NSManagedObject';_Ios - Fatal编程技术网

Ios 在类型为';NSManagedObject';

Ios 在类型为';NSManagedObject';,ios,Ios,出于某种奇怪的原因,我在尝试从CoreData对象访问.displayOrder时遇到困难。当我注销对象时,所有信息(包括订单数据)都会显示出来,因此我非常确定对象上存在数据 NSManagedObject *curObj = [_aFetchedResultsController objectAtIndexPath:fromIndexPath]; curObj.displayOrder (This is where I get error message - "displayOrder no

出于某种奇怪的原因,我在尝试从CoreData对象访问.displayOrder时遇到困难。当我注销对象时,所有信息(包括订单数据)都会显示出来,因此我非常确定对象上存在数据

NSManagedObject *curObj = [_aFetchedResultsController objectAtIndexPath:fromIndexPath];

curObj.displayOrder (This is where I get error message - "displayOrder not found....")
另外,当我执行self.curObj.displayOrder之类的操作时,.displayOrder也会出现,但当然不是这样工作的


希望有人能对此有所启发,并提前向您表示感谢

您可能应该使用自定义NSManagedObject,而不是从tableView中为对象分配通用NSManagedObject。例如

MyCustomObject *curObj = [_aFetchedResultsController objectAtIndexPath:fromIndexPath];

希望这能有所帮助。

整个崩溃日志是什么?是的,就是这样,现在有意义了,因为它找不到数据。再次感谢!:)