gpt4 book ai didi

iphone - Apple Mach-O 链接器错误 (IAP)

转载 作者:可可西里 更新时间:2023-11-01 06:18:48 26 4
gpt4 key购买 nike

我正在为应用内购买而苦恼。每当我导入 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

最佳答案

因为您添加的是“ header ”,而不是二进制文件。将 StoreKitFramework 放入带有库的 buildPhase->Link 二进制文件中。神奇的是,这会起作用;)

关于iphone - Apple Mach-O 链接器错误 (IAP),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13086159/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com