20

I have created a static library in Iphone SDK in which I used some UIDevice properties. When I run the app, this xcode show this error UIDevice Undeclared... Even the same code is running perfectly fine while I don't create static libraries and just build the source files.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Arsalan Haider
  • 559
  • 3
  • 9
  • 23
  • I'm getting this too in my new static library, for UIDevice and also for UIApplicationWillTerminateNotification - the references worked fine in my main app. They are both in UIKit.framework, which I've added to my library's 'Link Binaries With Libraries' list, but I get undeclared errors. – Surfbutler Sep 29 '11 at 15:30

1 Answers1

63

Have you tried adding

#import <UIKit/UIKit.h>

...to the top of your class .h file? I was running into similar problems as you are having, but when I added that import into my .h files that seemed to fix a lot of the errors.

starball
  • 20,030
  • 7
  • 43
  • 238
andyengle
  • 1,080
  • 12
  • 10