i'm using method validate products: - array of products, first parse xml file downloaded server, , list of products, ids invalid.
- (void) validateproductsidentifiers:(nsarray *) products { nsmutablearray *productsids = [[nsmutablearray alloc] init]; if (products != nil) { (ejbookinstore * book in products) { //for each book, save book id [productsids addobject:[book idbook]]; } //verify if array not empty if ([productsids count] > 0) { skproductsrequest *productsrequest = [[skproductsrequest alloc] initwithproductidentifiers:[nsset setwitharray:productsids]]; productsrequest.delegate = self; [productsrequest start]; } } else { nslog(@"erro..."); } when put id directly in method, id validate:
- (void) validateproductsidentifiers:(nsarray *) products { nsmutablearray *productsids = [[nsmutablearray alloc] init]; if (products != nil) { (ejbookinstore * book in products) { //for each book, save book id [productsids addobject:[book idbook]]; } //verify if array not empty if ([productsids count] > 0) { //when set id this, id validated nsarray *prodids = [nsarray arraywithobjects:@"com.example.booka", nil]; skproductsrequest *productsrequest = [[skproductsrequest alloc] initwithproductidentifiers:[nsset setwitharray: prodids]]; productsrequest.delegate = self; [productsrequest start]; } } else { nslog(@"error..."); } }
Comments
Post a Comment