headerfile not found

∥☆過路亽.° 提交于 2019-12-04 12:25:08

In fact you really don't need to import the header manually in most cases. just add Coredata.framework to build phases as below:

Now look at left in project navigator, you see CoreData.framework added. open Header folder and simply you can find NSFetchedResultsController.h. For testing its existence, you can type:

CoreData/NSFet

and voila, code suggestion tells you what you wanted . look at the picture below:

IMPORTANT: this is available only for iOS 3 or higher

"NSFetchedResultsController.h" is part of the CoreData framework, you have to

#import <CoreData/CoreData.h>

You also have to add the CoreData framework to the libraries that your app is linked with:

  • Select your target in Xcode.
  • Click on "Build Phases".
  • In the "Link Binary With Libraries" section, click on "+" and add "CoreData.framework".

Sorry if this discussion is very basic for advanced programmers, but it may be useful for advanced programmers who have recently moved to Cocoa, or for beginners in Cocoa/Xcode. This may worth to have a look.

When you want to add a new header which is not included by default , you can first search google for that class reference in Apple Developer ( you can do that directly from your Xcode > Organizer ( at right top of Xcode window ) You should see a page like this:

Two most important things are : 1- Framework 2- Inherits From and
Then check the framework in your Build Phases> Link Binary With Libraries and add it if not exist. By This , you should never encounter such a problem.

Check if the file is exist in the project folder, if yes, go to the project, select the app under targets section, go to build phases, open compile source then add the file NSFetchedResultsController.m.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!