2012-02-29 113 views
1

在接口文件下面的代码我得到的错误“未知类型名RefreshScreen”未知类型的错误

#import <UIKit/UIKit.h> 
#import <Storekit/Storekit.h> 
#import "RefreshScreen.h" 

@interface ViewControllerWordHelper : UIViewController <SKProductsRequestDelegate, SKPaymentTransactionObserver, UITextFieldDelegate, UIAlertViewDelegate> {  

RefreshScreen *rs; 
} 

@property(nonatomic, retain) RefreshScreen * rs; 

@end; 

在同一个项目中,我已经RefreshScreen类中定义RefreshScreen.h和RefreshScreen.m,他们有没有错误。

任何帮助表示赞赏。

+0

尝试使用'@class RefreshScreen'而不是'#import“RefreshScreen.h”' – 2012-02-29 09:58:34

+0

并检查是否y你的项目中有一个圈,这意味着两个类相互导入,这使编译器感到困惑。这个问题的一个很好的答案可以在这里找到:http://stackoverflow.com/questions/7896440/objective-c-header-file-not-recognizing-custom-object-as-a-type – 2012-02-29 10:00:35

+0

谢谢塞巴斯蒂安。将其更改为类可解决问题。 – saman01 2012-02-29 10:34:27

回答