Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

ListView.SelectedItem throwing an unknown exception.

$
0
0

In my app, I set the selected item in a ListView programmatically using the SelectedItem property. This worked before 1.3. It continues to work on Android. However, on iOS, it crashes with an unknown exception and neither Xamarin Studio nor Visual Studio can give me a call stack. I even put the call in a try...catch block, but it doesn't even make it into the catch. Here's some psuedo code:

void Select( int id )
{
        foreach( ListObject o in _listObjects )
        {
                if( o.id == id )
                {
                        listView.SelectedItem = o;
                }
        }
}

That's it. I can set a breakpoint on the SelectedItem call, the break point will be hit, as soon as I resume in any fashion (step over, continue, etc.), the app crashes.

Ideas?


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>