UITextField calls -setText upon first responder resignation

Originator:and.mikhaylov
Number:rdar://22872412 Date Originated:27-Sep-2015 02:04 PM
Status:Open Resolved:
Product:iOS Product Version:9.0.1
Classification:Serious Bug Reproducible:Always
 
Summary:
UITextField calls -setText: upon first responder resignation. This is unexpected and should not happen. In my case I have a CurrencyTextField which does not allow setting text directly, instead developer should use a separate property which computes text property and sets it via -[super setText:].

(
       …

	3   MyApp                            0x000000010c618825 -[CurrencyTextField setText:] + 117
	4   UIKit                               0x000000010ec65894 -[UITextField _endedEditing] + 162
	5   UIKit                               0x000000010ec6ff53 -[UITextField willDetachFieldEditor:] + 94
	6   UIKit                               0x000000010e451453 -[UIFieldEditor becomeFieldEditorForView:] + 304
	7   UIKit                               0x000000010ec64909 -[UITextField _resignFirstResponder] + 239
	8   UIKit                               0x000000010e4dee56 -[UIResponder _finishResignFirstResponder] + 292
	9   UIKit                               0x000000010ec6476e -[UITextField _finishResignFirstResponder] + 49
	10  UIKit                               0x000000010e4deb91 -[UIResponder becomeFirstResponder] + 328
	11  UIKit                               0x000000010e380cf5 -[UIView(Hierarchy) becomeFirstResponder] + 138
	12  UIKit                               0x000000010e4def52 -[UIResponder resignFirstResponder] + 217
	13  UIKit                               0x000000010ec6463b -[UITextField resignFirstResponder] + 136
	14  MyApp                            0x000000010c6a7cc5 -[UITextField(GFObscurePasswords) GFlookback_resignFirstResponder] + 22
	15  UIKit                               0x000000010ec75fcd -[UIView(UITextField) endEditing:] + 199
	16  MyApp                            0x000000010c5dab47 -[MyViewController _dismissSelectedRow] + 87
	17  MyApp                            0x000000010c5e9b78 -[MyViewController _handleDone:] + 56
	18  UIKit                               0x000000010e2e31fa -[UIApplication sendAction:to:from:forEvent:] + 92
	19  UIKit                               0x000000010e6c5247 -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 152
	20  UIKit                               0x000000010e2e31fa -[UIApplication sendAction:to:from:forEvent:] + 92
	21  UIKit                               0x000000010e447504 -[UIControl sendAction:to:forEvent:] + 67
	22  UIKit                               0x000000010e4477d0 -[UIControl _sendActionsForEvents:withEvent:] + 311
	23  UIKit                               0x000000010e44794b -[UIControl _sendActionsForEvents:withEvent:] + 690
	24  UIKit                               0x000000010e446906 -[UIControl touchesEnded:withEvent:] + 601
	25  UIKit                               0x000000010e34daa3 -[UIWindow _sendTouchesForEvent:] + 835
	26  UIKit                               0x000000010e34e691 -[UIWindow sendEvent:] + 865
	27  UIKit                               0x000000010e300752 -[UIApplication sendEvent:] + 263
	28  MyApp                            0x000000010c6bab77 -[UIApplication(GFInterceptEvents) GFlookback_sendEvent:] + 514
	29  UIKit                               0x000000010e2dbfcc _UIApplicationHandleEventQueue + 6693
	30  CoreFoundation                      0x0000000110b700a1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
	31  CoreFoundation                      0x0000000110b65fcc __CFRunLoopDoSources0 + 556
	32  CoreFoundation                      0x0000000110b65483 __CFRunLoopRun + 867
	33  CoreFoundation                      0x0000000110b64e98 CFRunLoopRunSpecific + 488
	34  GraphicsServices                    0x00000001134f1ad2 GSEventRunModal + 161
	35  UIKit                               0x000000010e2e1676 UIApplicationMain + 171
	36  MyApp                            0x000000010c62084f main + 111
	37  libdyld.dylib                       0x000000011144d92d start + 1
	38  ???                                 0x0000000000000001 0x0 + 1
)


Steps to Reproduce:
Make UITextField first responder, then resignFirstResponder using [self.view endEditing:YES];

Expected Results:
Describe what you expected to happen when you executed the steps above.

Actual Results:
Explain what actually occurred when steps above were executed.

Regression:
Describe circumstances where the problem occurs or does not occur, such as software versions and/or hardware configurations.

Notes:
Provide additional information, such as references to related problems, workarounds and relevant attachments.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!