0

Am I the only one, or do others also have an error when doing

#import <EventKit/EventKit.h>

For some reason, this file cannot be found (10.8, XCode 4.4) even if XCode suggests it to me after typing a few letters!

Carelinkz
  • 936
  • 8
  • 27

2 Answers2

1

I tried this in a new project with Xcode 4.4. It worked fine.

Is your project you pinned to the 10.7 SDK? Check your Base SDK setting. It should be set to Latest OS X (OS X 10.8).

This is usually set in the project, but you may be overriding it in your target's settings as well.

Steven Fisher
  • 44,462
  • 20
  • 138
  • 192
  • Under the base application icon, I have "1 target, OS X SDK 10.8". I changed the project Build Settings to Basic, Levels and it is indeed 10.8. – Carelinkz Jul 28 '12 at 17:51
  • Just started a simple test project, and added the `import` to the Document.h. Like in the "big" project, I used Core Data. Like you, I have no problem. – Carelinkz Jul 28 '12 at 17:55
  • This is **strange**. I added the EventKit framework, and suddenly the #import does not work anymore! Perhaps I am doing something wrong with the framework inclusion. – Carelinkz Jul 28 '12 at 18:02
  • Solved. Thank you very much for confirming that I was doing something wrong. In the end, I included the framework in the wrong way. XCode accepted the framework, but somehow the path to the includes broke at the same time. This method worked: http://stackoverflow.com/questions/6334966/adding-framework-in-xcode-4 – Carelinkz Jul 28 '12 at 18:09
  • I'm very glad you solved it. Feel free to write up your own answer, if you can explain it simply. I wouldn't be offended, really. :) – Steven Fisher Jul 28 '12 at 21:37
1

Before XCode 4.4, I used to just drag a framework into the framework section of the navigator on the right. That worked and was intuitive. For some reason, it does not work for the EventKit framework (perhaps even all other frameworks). The framework is recognized, but breaks the #include. If it is done using the method in Adding Framework in Xcode 4, it works fine.

Community
  • 1
  • 1
Carelinkz
  • 936
  • 8
  • 27