Core data 如何将数据从tableviewcell传递到其他xib?

Core data 如何将数据从tableviewcell传递到其他xib?,core-data,xib,Core Data,Xib,我正在从核心数据中检索数据,现在我要更新它。 我正在NSManagedObject中传递数据,但我如何将数据传递到其他xib on cell tap,在那里我将更新该数据 有人能帮我吗?您只需在prepareforsgue: DetailViewController *controller = segue.destinationViewController; controller.detailObject = cellManagedObject; 如果您不知道prepareForSegue是如

我正在从核心数据中检索数据,现在我要更新它。 我正在NSManagedObject中传递数据,但我如何将数据传递到其他xib on cell tap,在那里我将更新该数据


有人能帮我吗?

您只需在
prepareforsgue:

DetailViewController *controller = segue.destinationViewController;
controller.detailObject = cellManagedObject;

如果您不知道
prepareForSegue
是如何工作的,那么您真的应该首先阅读它,而不是在这个论坛上提问:。

这里是解决方案:--(void)tableView:(UITableView)tableView didSelectRowAtIndexPath:(nsindepath*)indexath{//UITableViewCell*cell=[tableView cellForRowAtIndexPath:indexath];Detail_View detailViewController=[[Detail_View alloc]init];detailViewController.data=record;[self.navigationController-pushViewController:detailViewController-animated:YES];}这正是上面的解决方案,只是使用segues。(苹果建议使用segues,而不是在代码中创建控制器。)您的行
detailViewController.data=record与我的第二行完全相同。-->你应该接受这个答案。老兄,我刚才提到的没有“Seque”。但是谢谢你的回复。哥们,1。不,你没有提到。2.是否使用segue对解决方案无关紧要。