Note that there are some explanatory texts on larger screens.

plurals
  1. POIPhone Development - Custom Cel
    primarykey
    data
    text
    <p>I'm trying to create my own custom cell, but for some reason, it isn't appearing. I read a lot of example, the code looks like (at least for me) equal to others. I used the interface builder to recreate it (I deleted the Default View, add a TableViewCell, put Identifier = CustomCell, and wire up the Label with valueLabel).</p> <p>Can comeone help me?</p> <p>Thanks in advance.</p> <pre><code>//CustomCell.h #import &lt;UIKit/UIKit.h&gt; @interface CustomCell : UITableViewCell { IBOutlet UILabel *valueLabel; } @property(nonatomic, retain) IBOutlet UILabel *valueLabel; @end //CustomCell.C #import "CustomCell.h" @implementation CustomCell @synthesize valueLabel; - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { if ((self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])) { // Initialization code } return self; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } - (void)dealloc { [super dealloc]; } @end //Where I'm trying to use this cell. Here I imported the .h file (#import "CustomCell.h"): - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"CustomCell"; CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil]; cell = [[[CustomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } cell.valueLabel.text = @"Any text"; return cell; } </code></pre>
    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