I am trying to bind a ListView to ObservableCollection. It works on both Windows Phone and Android but when trying to run it on iOS - then I get the following exception:
> MonoTouch.Foundation.MonoTouchException: Objective-C exception thrown.
> Name: NSInternalInconsistencyException Reason: Invalid update: invalid
> number of rows in section 0. The number of rows contained in an
> existing section after the update (130) must be equal to the number of
> rows contained in that section before the update (0), plus or minus
> the number of rows inserted or deleted from that section (1 inserted,
> 0 deleted) and plus or minus the number of rows moved into or out of
> that section (0 moved in, 0 moved out).
and here is my code:
public partial class TransfersView : ContentPage
{
public TransfersView(TransfersViewModel model)
{
InitializeComponent();
BindingContext = model;
}
}
<ListView x:Name="Transfers" ItemsSource="{Binding Transfers}">
<ListView.ItemTemplate>
<DataTemplate>
<TextCell Text="{Binding Player}" />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
Does anyone have any idea of what is going on here? Please help :)
FavScripts.com is a free tool to save your favorite scripts and commands, then quickly find and copy-paste your commands with just few clicks.
Boost your productivity with FavScripts.com!