-1

“未知类型名称 'ViewController' 你的意思是 'UIViewController'”

这就是我得到的错误

#import <UIKit/UIKit.h>
#import <StoreKit/StoreKit.h>
#import "ViewController.h"

@interface PurchaseViewController : UIViewController <SKPaymentTransactionObserver, SKProductsRequestDelegate>
@property (weak, nonatomic) IBOutlet UILabel *productTitle;
@property (weak, nonatomic) IBOutlet UIButton *buyButton;
@property (weak, nonatomic) IBOutlet UITextView *productDescription;
- (IBAction)buyProduct:(id)sender;
@property (strong, nonatomic) SKProduct *product;
@property (strong, nonatomic) NSString *productID;
@property (strong, nonatomic) ViewController *homeViewController; //error here
- (void)getProductInfo:(UIViewController *)viewController;
@end
4

2 回答 2

2

@interface声明之前,添加这样的一行:

@class ViewController;

看看是否有帮助。

于 2013-04-29T21:50:40.047 回答
0

您需要导入可可库!

#import <Cocoa/Cocoa.h>

这应该够了吧。

于 2016-05-12T21:25:12.323 回答