UIDevice properties not working in static library

Arsalan Haider picture Arsalan Haider · Sep 7, 2011 · Viewed 7.9k times · Source

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.

Answer

andyengle picture andyengle · Oct 24, 2011

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.

Hope that helps.

Andy