2

I updated my xamarin ios-project to the unified API (64 Bit support). Everything worked as expected. The project builds and works.

But I detected one problem. The binding to UILabel.Text properties won't work anymore. All other bindings are still working (to a UIButton.Hidden property for example). Here is my code:

// Create bindings
var set = this.CreateBindingSet<MyView, MyViewModel>();
set.Bind(labelitem)      // not working
    .For(t => t.Text)
    .To(v => v.MyStringValue);
set.Bind(buttonitem)     // working
    .For(b => b.Hidden)
    .To(v => v.MyboolValue)
    .WithConversion(new InverseBoolValueConverter());
set.Apply();

I'm using MvvmCross for the bindings. Bevore the unified-update everything worked fine.

First I tried to change the Linker-Option to "don't link". Same problem.

Can anyone explain me, what's happen? Thanks

Edit

I found a info in the output while debugging my project:

Weak Target is null in MvxUILabelTextTargetBinding - skipping set

Joehl
  • 3,671
  • 3
  • 25
  • 53

1 Answers1

4

There are some issues that some people are seeing, others are not, with the new GC in the latest Xamarin "stable" releases (maybe differences between VS and XS - it's not clear...). You can read about these on https://github.com/MvvmCross/MvvmCross/issues/902 (with some background on Migrating to Unified API and new reference counting)

There's an attempt to address these in http://slodge.blogspot.co.uk/2015/02/351-alpha-release.html - please do try the alpha packages to see if they help.

If not, then the only accepted workaround right now is to promote your UILabel to a private variable in your View.

Community
  • 1
  • 1
Stuart
  • 66,722
  • 7
  • 114
  • 165
  • The private-variable-workaround solved this. Thank your for the answer and the useful links – Joehl Feb 10 '15 at 15:00