アプリ内購入に苦労しています。StoreKitをインポートするたびに、このエラーが発生します。
私は運がないまま何日もこれにいました..誰か助けますか?
ヘッダーファイル:
#import <StoreKit/StoreKit.h>
#define kInAppPurchaseManagerProductsFetchedNotification @"kInAppPurchaseManagerProductsFetchedNotification"
@interface InAppPurchaseManager : NSObject <SKProductsRequestDelegate>
{
SKProduct *proUpgradeProduct;
SKProductsRequest *productsRequest;
}
@end
実装ファイル:
#import "IAPManager.h"
@implementation InAppPurchaseManager
- (void)requestProUpgradeProductData
{
NSSet *productIdentifiers = [NSSet
setWithObject:@"com.runmonster.runmonsterfree.upgradetopro" ];
productsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:productIdentifiers];
productsRequest.delegate = self;
[productsRequest start];
}
#pragma mark -
#pragma mark SKProductsRequestDelegate methods
- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
{
NSArray *products = response.products;
proUpgradeProduct = [products count] == 1 ? [[products firstObject] retain] : nil;
if (proUpgradeProduct)
{
NSLog(@"Product title: %@" , proUpgradeProduct.localizedTitle);
NSLog(@"Product description: %@" , proUpgradeProduct.localizedDescription);
NSLog(@"Product price: %@" , proUpgradeProduct.price);
NSLog(@"Product id: %@" , proUpgradeProduct.productIdentifier);
}
for (NSString *invalidProductId in response.invalidProductIdentifiers)
{
NSLog(@"Invalid product id: %@" , invalidProductId);
}
[productsRequest release];
[[NSNotificationCenter defaultCenter] postNotificationName:kInAppPurchaseManagerProductsFetchedNotification object:self userInfo:nil];
}
@end
私を殺すエラー:
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_SKProductsRequest", referenced from:
objc-class-ref in IAPManager.o
ld: symbol(s) not found for architecture armv7
collect2: ld returned 1 exit status
"_OBJC_CLASS_$_SKProductsRequest", referenced from:
Objc-class-ref in IAPManager.o
Symbol(s) not found for architecture armv7
Collect2: Id returned 1 exit status