3

I have a DialogViewController with many elements and a search bar. When a user taps between the search bar and the cancel button fast, the Elements node of the Section in the following MonoTouch.Dialog.Elements.cs code is sometimes null so it throws an error and the app is torn down by the OS. Is there a work around?

From Elements.cs, latest Git version. Only happens on a real device.

enter image description here

Ian Vink
  • 66,960
  • 104
  • 341
  • 555
  • I found this 'bug' too - I am just catching the NullReferenceException and ignoring it as there is always another search. – Darbio Jan 09 '12 at 10:43
  • https://github.com/migueldeicaza/MonoTouch.Dialog/issues/94 bug reported – Darbio Jan 09 '12 at 10:54

1 Answers1

3

To turn this into an answer - I think this is a bug.

I have filed it at:

And produced a sample which reproduces the bug at:

I think it may be a threading synchronisation issue where the thread is trying to access the Root.Elements but they have been removed by the Cancel button.

Darbio
  • 11,286
  • 12
  • 60
  • 100