Your Delegate
instance has probably been GCed before it is called. Try this:
Delegate delegate = new Delegate(textField);
this.textField.setDelegate(delegate);
this.textField.addStrongRef(delegate);
The addStrongRef(...)
call prevents the Delegate
Java instance from being GCed until the UITextField
Objective-C instance is deallocated. This is required since UITextField
does not retain (increase the reference count of) the instance you set as delegate.
In a future version of RoboVM the addStrongRef(...)
call will be done automatically for you.