Note that there are some explanatory texts on larger screens.

plurals
  1. POCustom UITableViewCell not calling prepareForSegue
    primarykey
    data
    text
    <p>I have a custom UITableViewCell, called <code>EventCell</code>.</p> <p><strong>EventCell.h</strong></p> <pre><code>#import &lt;UIKit/UIKit.h&gt; @interface EventCell : UITableViewCell @property (nonatomic, strong) IBOutlet UILabel *titleLabel; @property (nonatomic, strong) IBOutlet UILabel *locationLabel; @property (nonatomic, strong) IBOutlet UILabel *dateLabel; @property (nonatomic, strong) IBOutlet UILabel *typeLabel; @end </code></pre> <p><strong>EventCell.m</strong></p> <pre><code>#import "EventCell.h" @implementation EventCell @synthesize titleLabel, locationLabel, dateLabel, typeLabel; - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { // Initialization code } return self; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } @end </code></pre> <p>Here is how I'm setting up my cell.</p> <p><strong>EventsMasterViewController.m</strong></p> <pre><code>- (EventCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { Event *myEvent; NSString *CellIdentifier = @"EventCell"; EventCell *cell = (EventCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"EventCell" owner:nil options:nil]; for (id currentObject in topLevelObjects) { if ([currentObject isKindOfClass:[EventCell class]]) { cell = (EventCell *)currentObject; break; } } myEvent = [self.myEventsDataController objectInListAtIndex:indexPath.row]; cell.titleLabel.text = myEvent.name; cell.locationLabel.text = myEvent.location; cell.typeLabel.text = @"Social"; cell.layer.borderColor = [UIColor blackColor].CGColor; cell.layer.borderWidth = 1.0; return cell; } </code></pre> <p>The cell is being formatted great, it looks exactly as I need it to. But when I click on it, the cell highlights blue and doesn't segue to the next view. I put a breakpoint in my prepareForSegue method and it's not even getting called.</p> <p>Is there some way to call prepareForSegue manually? If so, where should I do that.</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.
 

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