문제점 :editingChanged
이벤트를 처리하는 방법과 개체 모델에서 내 텍스트 필드를 업데이트하는 다른 방법이 있습니다. 문제는 이벤트를 보낸 필드의 텍스트를 수정하면 editingChanged가 다시 트리거되고 무한 루프 (ios 5에서만 사용 가능)를 입력한다는 것입니다.텍스트 필드 무한 루프를 편집하십시오.
예 :이 문제를 해결하려면 어떻게해야
- (IBAction)updateFields:(UITextField *)sender {
if ([self myCustomValidation:sender]) {
... //update model
//call another method that essentially does this
field1.text = @"someformatted text"; //causes infinite loop if any field == sender
field2.text = @"some more text";
}
}
(setText:
메시지를 보내는 모든 방법을 sender
을 통과하지 않고)?
UITexfeild를 사용하고 있습니까? –