Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

So I've done some research into this issue, but I haven't found anything similar just yet...

So I'm coding a game in Obj-C using Xcode and Sparrow Framework. I've been working on the simulator up until this point, and it's all been going fine. But when I switch to running it on my device, I get all sorts of errors for things that should be standard, e.g. "Cannot find interface declaration for NSObject", "Unknown type name 'NSMutableArray'" etc. I've already got #import in each class, so you would think that it shouldn't happen, right? I get the feeling that it's just a line or two that needs changing somewhere - but I haven't got a clue what or where.

If anyone has any advice, it would be very much appreciated. :)

EDIT: Here's a screenshot of one of the .h files that give errors - it seems to only be in some of the .h files that I've created. http://i.imgur.com/EuQh4.png

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
552 views
Welcome To Ask or Share your Answers For Others

1 Answer

This can be caused by not including UIKit.

Add this to your header:

#include <UIKit/UIKit.h>

Also make sure to add the UIKit Framework to your project. (Targets/Build Phases/Link Binary With Libraries/ -- Select Add --- Add UIKit.Framework)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...