Note that there are some explanatory texts on larger screens.

plurals
  1. POUITableView in Storyboard appears empty
    text
    copied!<p>It's my first time using Storyboard to build an app. I'm trying to create a UITableView with a custom cell. I've created the cell in IB and created a custom tableViewCell class for it (added some labels, created appropriate outlets, connected them in IB and assigned the custom class to the custom cell in IB).</p> <p>In the ViewController responsible for the TableView I create the data source (a dict with some arrays) and fill out all the obligatory methods (I've tried both with UITableViewControler and with a UIViewController that is set as a delegate and data source for the tableview)</p> <p>And when I run the app - the tableview is empty. And after doing some NSLogging I've noticed that the data source methods are never executed. And I have NO IDEA why. </p> <p>I'm going crazy about this for a few hours now. Please help me out :)</p> <p>Let me know if you need to see the code or Storyboard, or whatever else. </p> <p><strong>UPDATE:</strong> Alright, after some digging, I've decided to test out the same code but using an NSMutableArray as data source instead of a NSMutableDictionary. And it works! Now, could someone explain to me why it didn't work with a dict?</p> <p>Here's what did. I had a dict with 5 arrays, and each array had 5 strings. </p> <p>In the numberOfRowsForSection method, I returned [dict count]</p> <p>And in the cellForRowAtIndexPath method, I've used this code</p> <pre><code>NSArray * routeArray = [dealsDict objectForKey:@"route"]; cell.routeName.text = [routeArray objectAtIndex:indexPath.row]; NSArray * companyArray = [dealsDict objectForKey:@"company"]; cell.companyName.text = [companyArray objectAtIndex:indexPath.row]; NSArray * priceArray = [dealsDict objectForKey:@"price"]; cell.priceLabel.text = [priceArray objectAtIndex:indexPath.row]; NSArray * dateArray = [dealsDict objectForKey:@"date"]; cell.dateLabel.text = [dateArray objectAtIndex:indexPath.row]; NSArray * monthArray = [dealsDict objectForKey:@"month"]; cell.monthLabel.text = [monthArray objectAtIndex:indexPath.row]; NSLog(@"I'm in here"); return cell; </code></pre> <p>why didn't it want to show anything?</p>
 

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