Note that there are some explanatory texts on larger screens.

plurals
  1. POtableView:didSelectRowAtIndexPath - message sent to deallocated instance
    primarykey
    data
    text
    <p>I have read much topics, but I nothing works. I have a code, but when I click a cell I get this error: <code>*** -[ModeViewController tableView:didSelectRowAtIndexPath:]: message sent to deallocated instance 0x764df40</code><br> Code:<br> ModeViewController.h</p> <pre><code>@interface ModeViewController : UIViewController &lt;UITableViewDelegate, UITableViewDataSource&gt; @property (nonatomic, strong) UITableView *tableViewModeSelection; @end </code></pre> <p>ModeViewController.m</p> <pre><code>@implementation ModeViewController @synthesize tableViewModeSelection; - (void)viewDidLoad { tableViewModeSelection = [[UITableView alloc] initWithFrame:CGRectMake(10, 80, screenRect.size.width - 20, screenRect.size.height - 90) style:UITableViewStyleGrouped]; tableViewModeSelection.dataSource = self; tableViewModeSelection.delegate = self; [self.view addSubview:tableViewModeSelection]; } - (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]; cell.selectionStyle = UITableViewCellSelectionStyleNone; } cell.textLabel.text = [modes objectAtIndex:indexPath.row]; cell.backgroundView = [[UIView alloc] initWithFrame:CGRectZero]; return cell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSLog(@"Selected at row: %i", indexPath.row); } </code></pre> <p>What could be the problem?<br> Thanks in advance.</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