Note that there are some explanatory texts on larger screens.

plurals
  1. POios ARC table bad access
    text
    copied!<p>for my table view I have the following going on (paraphrased)</p> <h1>.h</h1> <pre><code>@interface OptionsView : UIView &lt;UITableViewDelegate, UITableViewDataSource&gt; @property (nonatomic, retain) NSArray *dataSource; </code></pre> <h1>.m</h1> <pre><code>- (id)initWithCoder:(NSCoder *)aDecoder { self = [super initWithCoder:aDecoder]; if (self) { ... self.dataSource = [NSArray arrayWithObjects:options, sections, sponsor, nil]; } return self; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if(self.dataSource) { NSArray *ds = [self.dataSource objectAtIndex:indexPath.section]; NSDictionary *d = [ds objectAtIndex:indexPath.row]; ActionBlock a = [d objectForKey:ACTION]; // &lt;-- Thread 1: EXC_BAD_ACCESS (code=2, address=0x802) if(a != nil) a(); } } </code></pre> <p>You can see that in my <code>didSelectRowAtIndexPath</code> I'm getting an <code>EXC_BAD_ACCESS</code> but I'm not sure why. Because I'm using arc it isn't a zombie problem (already checked).</p> <p>Using breakpoints I see that the <code>self.dataSource</code> exists after it's initialized, but not later when it's needed. It doesn't show up as <code>&lt;nil&gt;</code> either, it's just white space. Also, this works in debug but not in release so what does that mean?</p> <p>** EDIT adding a screenshot **</p> <p>You will notice that neither <code>ds</code> or <code>d</code> show up.. odd? <img src="https://i.stack.imgur.com/ona3v.png" alt="xcode debug"></p>
 

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