码迷,mamicode.com
首页 > 其他好文 > 详细

Receiver 'NSManagedObjectContext' for class message is a forward declaration 错误的解决方案

时间:2015-02-27 11:23:35      阅读:4404      评论:0      收藏:0      [点我收藏+]

标签:

 

All the CoreData header files are imported in App_Prefix.pch, so the CoreData classes will be available throughout your Project, so you don‘t have to manually import the header in the files you need them.

So open up Xcode and look for some file like App_Prefix.pch, by default it‘s in the Other Sources group. After the UIKit import statement, add the following line:

#import <CoreData/CoreData.h>

And you should be ready to go.

Xcode 4

For projects created in Xcode 4, the prefix file can be found in the Supporting Files group in the Project navigator. It‘s called ‘projectname-Prefix.pch‘ by default.

 

 

详见 http://stackoverflow.com/questions/2032818/adding-core-data-to-existing-iphone-project

 

 

PS:之前作为返回函数参数类型的NSManagedObjectContext并没有报错,但是在[[NSManagedObjectContext alloc] init]的时候,却突然报了标题的错误,让我没有联想到头文件引用那一块去,但实际上还是头文件没有引用的问题,还是觉得有点奇怪。 

Receiver 'NSManagedObjectContext' for class message is a forward declaration 错误的解决方案

标签:

原文地址:http://www.cnblogs.com/Kelphizy/p/4302846.html

(0)
(1)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!