Receiver ' Nsmanagedobjectcontext ' for class message is a forward declaration wrong solution

Source: Internet
Author: User

All the CoreData header files is imported App_Prefix.pch in, so the CoreData classes would 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 UIKit the import statement, add the following line:

#import <CoreData/CoreData.h>

And you should is ready to go.

Xcode 4

For projects created in Xcode 4, the prefix file can is found in the Supporting Files group in the Project Navigator. It ' s called 'projectname-prefix.pch ' by default.

See Http://stackoverflow.com/questions/2032818/adding-core-data-to-existing-iphone-project

PS: Nsmanagedobjectcontext, which was previously returned as a function parameter type, did not report an error, but when [[Nsmanagedobjectcontext alloc] init], it was suddenly reported that the title was wrong, Let me not associate to the header file to refer to that piece, but in fact, it is not a reference to the first file, still feel a bit strange.

Receiver ' Nsmanagedobjectcontext ' for class message is a forward declaration wrong solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.