MvvmCross Failed to create target binding for EditingDidBegin on iPhone

前端 未结 1 977
孤独总比滥情好
孤独总比滥情好 2021-01-19 11:43

I have an application which binds to EditingDidBegin. It works fine on the iPhone Simulator (iOS 7) but when running on an actual iPhone I get the following warning message

相关标签:
1条回答
  • 2021-01-19 12:15

    This type of message - coupled with the 'it works in the simulator' evidence - almost always means that the linker has removed the symbol.

    Instead of "change the project settings to Link All Assemblies", can you add a line to "LinkerPleaseIgnore.cs" (or to some other file) which tricks the linked into including the event.

    e.g. include a file like https://github.com/slodge/NPlus1DaysOfMvvmCross/blob/master/N-38-Maps/Mappit.Touch/LinkerPleaseInclude.cs with a method like:

        public void Include(UITextField textField)
        {
            textField.Text = textField.Text + "";
            textField.EditingChanged += (sender, args) => { textField.Text = ""; };
            textField.EditingDidBegin += (sender, args) => { textField.Text = ""; };
            textField.EditingDidBegin -= (sender, args) => { textField.Text = ""; };
        }
    

    This will hopefully trick the linker into including the textField.EditingDidBegin symbol

    0 讨论(0)
提交回复
热议问题