I'm trying to add an objective C library for toasts to my xcode project. But I'm getting a number of these errors:
"Cannot find interface declaration for 'UIView'"
"Expected a type"
I have linked with the QuartzCore.framework. And the .m file has been added to compile sources. What am I missing? I'm a newbie to ios. Please help.
This is a bug in the library. The header file (UIView+Toast.h
) uses UIView
but doesn't import <UIKit/UIKit.h>
, so copying its source files into your project can give you this error.
(UPDATE: This bug was fixed on October 14, 2014.)
One way to fix this is to add #import <UIKit/UIKit.h>
to the top of UIView+Toast.h
.
Another way is to add #import <UIKit/UIKit.h>
to your target's .pch
file in the “Supporting Files” group, if your project has a .pch
file. It looks like Xcode 6's project templates don't include a .pch
file, so you might not be able to use this fix easily.
Be sure to include UIKit, which is where UIView
is defined: #import <UIKit/UIKit.h>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With