我在一个类中使用该属性:
@property (nonatomic, strong) NameOfMyClass* form;
当我在主函数中使用该代码时: form = formToSend;
//CHECK MANDATORIES
BOOL validMandatories = (0 != [self checkMandatoryFieldsWithForm:form withTableView:self.tableView withForm:self.formController]);
if (validMandatories)
{
[self submitRegistrationForm];
}
以及子函数中的代码:
- (void)submitRegistrationForm
{
[self.view setUserInteractionEnabled:NO];=> change the form address
....
}
它改变了表单类的地址。在 [self.view setUserInteractionEnabled:NO] 之前
Printing description of self->form:
<RegistrationForm_Renault_Control_Adagio: 0x7f81bf8a0200>
[self.view setUserInteractionEnabled:NO] 之后
Printing description of self->form:
<RegistrationForm_Renault_Control_Adagio: 0x7f81c092b600>
我避免该问题的解决方案,但我什至想了解为什么...
NameOfMyClass* formTemp = form;
[self.view setUserInteractionEnabled:NO];
form = formTemp;
有什么解释吗?