Note that there are some explanatory texts on larger screens.

plurals
  1. POOutlet in a Static Table Cell Causes EXC_BAD_ACCESS on load
    primarykey
    data
    text
    <p>I am creating a simple Static Table with 2 sections, 2 Cells in each section. the Table View controller (TVC) is <code>Subclassed</code>. </p> <p>Within each of the table cells I have a stepper Control, and and a label. I am using this to allow for updating though an <code>IBAction</code> from the Stepper, setting a property in the TVC. At the same time the label is updated through it's outlet to show the current value.</p> <p>The outlet is defined in the @interface section of the "TVC.m" file as is normal using the standard IB tools. </p> <p>On run it breaks on the Thread 1 level <code>under UIApplicationMain</code> in something named _0 obj_loadWeakRetained_ and the error is:</p> <blockquote> <p>THREAD 1: EXC_BAD_ACCESS(code -2, address = 0x1da7cc0. </p> </blockquote> <p>Any idea what I may be doing incorrectly? is there something that has to be done differently when adding views to <code>tablecells</code> and setting outlets to them? Here's the code - nothing unusual.</p> <pre><code>#import "AdvancedTVC.h" @interface AdvancedTVC () - (IBAction)stepperChanged:(UIStepper *)sender; - (IBAction)switchToggled:(UISwitch *)sender; @end @implementation AdvancedTVC - (IBAction)stepperChanged:(UIStepper *)sender { } - (IBAction)switchToggled:(UISwitch *)sender { } - (id)initWithStyle:(UITableViewStyle)style { self = [super initWithStyle:style]; if (self) { // Custom initialization } return self; } - (void)viewDidLoad { [super viewDidLoad]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [super tableView:tableView cellForRowAtIndexPath:indexPath]; // Configure the cell... return cell; } #pragma mark - Table view delegate - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { } @end </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