iOS: Why [self.view setUserInteractionEnabled:NO] is changing my class address?

54 Views Asked by At

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?

0

There are 0 best solutions below