Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS SDK broken ever after reinstall UIKit and Foundation frameworks not found

For the pch file I get these errors:

/Users/matt/Programming/iPhone Monkey Curling lite/iPhone_Monkey_Curling_Prefix.pch:6:34: error: Foundation/Foundation.h: No such file or directory

/Users/matt/Programming/iPhone Monkey Curling lite/iPhone_Monkey_Curling_Prefix.pch:7:24: error: UIKit/UIKit.h: No such file or directory

Here's the file as it is by default:

//
// Prefix header for all source files of the 'iPhone Monkey Curling' target in the 'iPhone Monkey Curling' project
//

#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#endif

I reinstalled Xcode and the iOS SDK but that did not fix the problem. This problem occurred after adding the iAd framework to one of my projects but all of my projects won't compile.

I'm using the latest SDK (4.1).

The frameworks are there in the project. For some reason, when I try to add a new framework, it lists the OS X ones in an iOS project.

Thank you for any help.

like image 870
Matthew Mitchell Avatar asked Dec 01 '22 04:12

Matthew Mitchell


2 Answers

On the Apple developer forums I managed to get help on pin-pointing the issue. It turns out somehow a build option was set to something odd.

It was the "Framework Search Paths" option. Make sure this is empty if anyone has a similar problem.

like image 70
Matthew Mitchell Avatar answered Dec 05 '22 10:12

Matthew Mitchell


I'd like to add to the Matthew's answer:

Actually, the Framework Search Paths shouldn't be empty, but it should include only the paths to the SDK's Frameworks folders. In my case simulator worked with this path:

/Applications/Xcode.app/Contents/Developer/Platforms/_**iPhoneSimulator.platform**_/Developer/SDKs/iPhoneOS6.0.sdk/System/Library/Frameworks/

and device started working when I added this one:

/Applications/Xcode.app/Contents/Developer/Platforms/_**iPhoneOS.platform**_/Developer/SDKs/iPhoneOS6.0.sdk/System/Library/Frameworks/

Thi is for XCode Version 4.5.1 (4G1004).

like image 41
Yuriy Polezhayev Avatar answered Dec 05 '22 08:12

Yuriy Polezhayev