Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>.h file The 'define' is put after the #import statements at top of header file, and was put as 0 because I don't know how else to define it:</p> <pre><code>#define kMyTag 0 </code></pre> <p>.m file I have updated this section as per your comments, but a) the table is not populated, b) when the user has navigated to the next view and goes back to this view it fails with a "unrecognized selector sent to instance", and c) I had to put in the two 'return cell;' entries or it falls over. I think I have things in the wrong order and maybe didn't initialise things properly????</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; cell.selectionStyle = UITableViewCellSelectionStyleNone; UILabel *label = [[[UILabel alloc] init] autorelease]; label.tag = kMyTag; // define kMyTag in your header file using #define label.font = [UIFont fontWithName:@"Arial-BoldMT" size:20]; label.frame = CGRectMake(10.0f, 10.0f, 220.0f, 22.0f); label.textColor = [UIColor blackColor]; label.backgroundColor = [UIColor clearColor]; label.opaque = NO; CustomCellBackgroundView *bgView = [[CustomCellBackgroundView alloc] initWithFrame:CGRectZero]; bgView.borderColor = [UIColor clearColor]; bgView.fillColor = [UIColor whiteColor]; bgView.position = CustomCellBackgroundViewPositionSingle; cell.backgroundView = bgView; [cell.contentView addSubview:label]; // addSubview here and only here return cell; } UILabel *label = (UILabel *)[cell.contentView viewWithTag: kMyTag]; label.text = [mapareaArray objectAtIndex:indexPath.row]; return cell; } </code></pre>
 

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