0

I use that property in a class:

@property (nonatomic, strong) NameOfMyClass* form;

When I use that code in my main function: form = formToSend;

//CHECK MANDATORIES
BOOL validMandatories = (0 != [self checkMandatoryFieldsWithForm:form withTableView:self.tableView withForm:self.formController]);

if (validMandatories)
{
    [self submitRegistrationForm];
}

and that code in the sub function:

- (void)submitRegistrationForm
{
    [self.view setUserInteractionEnabled:NO];=> change the form address
    ....

}

It changes the address of the form class. Before the [self.view setUserInteractionEnabled:NO]

Printing description of self->form:
<RegistrationForm_Renault_Control_Adagio: 0x7f81bf8a0200>

After the [self.view setUserInteractionEnabled:NO]

Printing description of self->form:
<RegistrationForm_Renault_Control_Adagio: 0x7f81c092b600>

My solution to avoid the problem, but I would even like to understand why...

NameOfMyClass* formTemp = form; 
[self.view setUserInteractionEnabled:NO];
form = formTemp; 

Any explanations?

ΩlostA
  • 2,501
  • 5
  • 27
  • 63
  • Look's like you have undefined behavior. Try to run Product->Analyze. Check address sanitizer and undefined behavior sanitizer options. – Cy-4AH Jul 11 '18 at 14:41
  • It definitely is not your `setUserInteractionEnabled` code. Please show us the three lines: print address, setUserInteraction, print address again – Andreas Oetjen Jul 11 '18 at 17:03

0 Answers0