saturngod / IAPHelper

No more maintenance for this repo. Please use the https://github.com/bizz84/SwiftyStoreKit
MIT License
1.55k stars 280 forks source link

empty array on line 12 #19

Closed MauKappel closed 8 years ago

MauKappel commented 9 years ago

Hey, when take the example code, change the product ID and run the code, I get the error "[__NSArrayI objectAtIndex:]: index 0 beyond bounds for empty array" on the line of the declaration of product. Why? Many thanks in advance

saturngod commented 9 years ago

Hi @easybay , can you share your code ? How did you allocated the array ? It look like array is not allocated.

ClickedApps commented 8 years ago

It's the example code. Copied and paste, same error.

saturngod commented 8 years ago

@ClickedApps

Look like error at

SKProduct* product =[[IAPShare sharedHelper].iap.products objectAtIndex:0];

Did you register your product identifier at iTunes Connect ?

saturngod commented 8 years ago

I checked it and this error occur because you didn't register any products. So, SKProductsResponse didn't response any product.

However, example code is trying to get index 0. So, this error occur. Please register your in app purchases first.