我正在尝试做 inaAppPurchases 并使用以下代码
NSSet *myProductIdentifiers = [NSSet setWithObjects:
@"inapppurchase.first",
@"inapppurchase.second",
@"inapppurchase.third",
@"inapppurchase.fourth",
@"inapppurchase.fifth",
@"inapppurchase.sixth",
nil];
if ((self = [super initWithProductIdentifiers:myProductIdentifiers]))
{
}
return self;
///////////////////////////////////
- (id)initWithProductIdentifiers:(NSSet *)identifiers
{
if ((self = [super init]))
{
}
self.productIdentifiers = identifiers;
return self;
}
- (void)requestProducts
{
self.request = [[SKProductsRequest alloc] initWithProductIdentifiers:productIdentifiers];
request.delegate = self;
[request start];
}
- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
{
self.products = response.products;
SKProduct *product = [self.products objectAtIndex:0];
NSLog(@"%@", product.price);
self.request = nil;
}
问题是,当我调用requestProducts
然后调用委托函数 时- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
,产品的顺序与我的 NSSet 值不同
我的self.products的顺序是第五,第一,第二,第四,第六和第三。这是为什么?为什么顺序不正确?