iphone - 在普通类使用SKProduct

标签 iphone objective-c ios in-app-purchase

我在项目中设置了StoreKit,可以从应用商店中很好地获取产品信息,一切正常。

我现在想做的是在我的类中添加SKProduct作为实例变量,如下所示:

#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>

@interface VideoCell : UITableViewCell
{
    IBOutlet UILabel *title;
    IBOutlet UILabel *description;
    SKProduct *product;
}

@property (retain) IBOutlet UILabel *title;
@property (retain) IBOutlet UILabel *description;
@property (retain) SKProduct *product;

它仅适用于IBOutlet变量,但SKProduct行有错误,如下所示:
Unknown type name 'SKProduct'

我很困惑,因为类名会自动完成,但实际上并不会编译...

有任何想法吗?

最佳答案

好像您缺少导入:

#import <StoreKit/StoreKit.h>

关于iphone - 在普通类使用SKProduct,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10705324/

相关文章:

iphone - UITableview 只允许单向滑动删除

iphone - 按钮上的手势识别器

iphone - 如何在Objective-C中验证youtube URL?

ios - Objective-C -NSMutablearray 特定索引存储在另一个数组中

ios - UITableViewCellSelectionStyleGray 的 RGB 值是多少?

ios - 使用 SKShader 时性能下降

ios - 减小 AppStore 的 iOS 应用程序大小 (Xamarin)

ios - 无法将通用值分配给扩展中的协议(protocol) associatedType 变量

javascript - 有没有办法使用 JavaScript 控制 iPod Touch 的键盘方向?

ios - 将 CFAbsoluteTime 存储到 nsmutablearray