Note that there are some explanatory texts on larger screens.

plurals
  1. POreloadData from UITableViw does not work
    primarykey
    data
    text
    <p>I`m developing an in-app purchase app and after get the products pro app store I'm trying to load those products in a uitableview. The problem is: when I get the product list I cannot load the data inside the table. When I create the table using static values and without using reloadData everything works.</p> <p>Eeverything is working fine beside load the table</p> <p>where's my code:</p> <pre><code>@synthesize products; @synthesize productsTableView; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } - (void)viewDidLoad { NSSet *productIndentifiers = [NSSet setWithObjects:@"Prod01",@"Prod02",@"Prod03",nil]; productsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:productIndentifiers]; [productsRequest start]; [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:TRUE]; [super viewDidLoad]; } - (void)viewDidUnload { [self setProductsTableView:nil]; [super viewDidUnload]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); } #pragma mark - UITableViewDelegate - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return self.products.count; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = nil; [self.productsTableView dequeueReusableCellWithIdentifier:@"Cell"]; if(cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"MyCell"]; SKProduct *product = [self.products objectAtIndex:indexPath.row]; cell.textLabel.text = product.localizedTitle; } return cell; } #pragma mark - SKProductsRequestDelegate - (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response { NSLog(@"%@", response.products); [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:FALSE]; [self.productsTableView reloadData]; } - (void)dealloc { [productsTableView release]; [super dealloc]; } @end </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload