On an iPad running iOS 4.3.5 I get this error:
MonoTouch.Foundation.MonoTouchException: Objective-C exception thrown. Name: NSInvalidArgumentException Reason: -[UITextField hasText]: unrecognized selector sent to instance 0x6f692d0
at MonoTouch.UIKit.UITextField.get_HasText () [0x00000] in <filename unknown>:0
And indeed looking at Apple’s documentation, there is no “hasText” for UITextField. But it works, at least on iOS5 devices.
What is going on here? MT is 5.0.1 and the deployment target is set to 4.3. Is this selector new in iOS 5? But why is not documented?
René
Shivan is right —
HasTextis a MonoTouch thing.Here is one place where
HasTextis listed (it was introduced in MonoTouch between 4.2 & 5.0): http://ios.xamarin.com/Releases/MonoTouch_5/API-diff-from-4.2If you want
HasText, you need to run on iOS 5.0 & newer.