Note that there are some explanatory texts on larger screens.

plurals
  1. POUITableView not displaying data from array
    primarykey
    data
    text
    <p>Code:</p> <p>In .h:</p> <pre><code> NSMutableArray *contentArray; </code></pre> <p>I'm declaring my array.</p> <hr> <p>In .m</p> <pre><code> - (void)viewDidLoad { [super viewDidLoad]; contentArray = [[NSMutableArray alloc] initWithObjects:@"view", @"browse", @"create", nil]; // Uncomment the following line to preserve selection between presentations. // self.clearsSelectionOnViewWillAppear = NO; // Uncomment the following line to display an Edit button in the navigation bar for this view controller. // self.navigationItem.rightBarButtonItem = self.editButtonItem; } </code></pre> <h2>I'm setting it up in my view did load.</h2> <pre><code> - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { // Return the number of rows in the section. return [contentArray count]; } </code></pre> <p>I'm setting the number of rows to the array count.</p> <hr> <pre><code> - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } // Configure the cell... [[cell textLabel] setText:[contentArray objectAtIndex:indexPath.row]]; return cell; } </code></pre> <p>Nothing. But if I do "[[cell textLabel] setText:@"Hello World."];" instead, it works fine.</p>
    singulars
    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.
    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