I really appreciate that you've tried to help!

Just to clearify things, I can get the app to crash in the simulator too,
if I compile the app in release mode. I actually looked alot at Xamarin's
example add EmployerDirectory and I can't see whats differs my app from
theirs when it comes to how I perform a search and how I handle my
UITableViewController / UISearchDisplayController.


2013/8/1 Nic Wise <n...@fastchicken.co.nz>

> I suggest you try to distill it down to a small sample, and put a bug
> up on the Xamarin bugzilla site (bugzilla.xamarin.com).
>
> Very odd tho. Maybe also have a look at MonoTouch.Dialog which has a
> search box, but doesn't crash....
>
> Crashing on device vrs sim isn't uncommon tho - the sim is a proper
> JIT machine, same/similar as the desktop framework, and the GC isn't
> overly aggressive. Once you get it on the device, it's AOT, and the GC
> gets a lot more aggressive about releasing things.
>
> I've CCed in Rolf and Sebastien as they may have[*] better ideas
>
> [*]: "may have" -> are very likely to have.
>
> On 1 August 2013 10:20, Nordis <nordmark.dan...@gmail.com> wrote:
> > Same problem if I remove that code,
> > https://gist.github.com/Nordis/6129762
> >
> > I was able to reproduce the crash a lot quicker when I removed the code,
> > usually the crash occurs after 1-2 minutes. But with no code att all in
> > Dispose the crash occured after a few seconds.
> >
> > Also the crash only seems to happens when I compile in release mode.
> >
> >
> > 2013/8/1 Nic Wise [via MonoTouch] <[hidden email]>
> >>
> >> That SO question is from 2011, and the GC and other things have
> >> changed hugely since then, esp in 6.4 (the latest one) which is Mono
> >> 3.x as well as having a new GC by default
> >>
> >> So you may not even need to do that. What happens if you take it out
> >> completely?
> >>
> >> Rolf is often around here, so he may be able to expand on it a bit.
> >>
> >> On 1 August 2013 09:53, Nordis <[hidden email]> wrote:
> >>
> >> > Thanks for your quick reply,
> >> >
> >> > I've tried to change BeginInvokeOnMainThread to InvokeOnMainThread,
> but
> >> > still the same problem. The crash dump looks the same to me,
> >> > https://gist.github.com/Nordis/6129637
> >> >
> >> > Then I tried to remove InvokeOnMainThread and only set the properties
> to
> >> > null,
> >> >     searchController.Delegate = null;
> >> >     searchController.SearchResultsDelegate = null;
> >> >     searchController.SearchResultsSource = null;
> >> >
> >> > But then I got this exception,
> >> > MonoTouch.UIKit.UIKitThreadAccessException: UIKit Consistency error:
> you
> >> > are
> >> > calling a UIKit method that can only be invoked from the UI thread.
> >> >   at MonoTouch.UIKit.UIApplication.EnsureUIThread () [0x00000] in
> >> > <filename
> >> > unknown>:0
> >> >   at MonoTouch.UIKit.UISearchDisplayController.set_WeakDelegate
> >> > (MonoTouch.Foundation.NSObject value) [0x00000] in <filename
> unknown>:0
> >> >   at MonoTouch.UIKit.UISearchDisplayController.set_Delegate
> >> > (MonoTouch.UIKit.UISearchDisplayDelegate value) [0x00000] in <filename
> >> > unknown>:0
> >> >   at Diet52App.FoodSearchBase.Dispose (Boolean disposing) [0x00000] in
> >> > <filename unknown>:0
> >> >   at MonoTouch.Foundation.NSObject.Finalize () [0x00000] in <filename
> >> > unknown>:0
> >> >
> >> > I got the idea to set searchController's properties to null by reading
> >> > this
> >> > thread,
> >> >
> >> >
> http://stackoverflow.com/questions/6708705/monotouch-sigsegv-crash-using-navigationcontroller-and-searchdisplaycontroller?rq=1
> >> >
> >> > Best regards,
> >> >
> >> > Daniel
> >> >
> >> >
> >> > 2013/8/1 Nic Wise [via MonoTouch] <[hidden email]>
> >> >>
> >> >> Hi Nordis
> >> >>
> >> >> If I had to guess, I'd say this is the problem
> >> >>
> >> >> protected override void Dispose (bool disposing)
> >> >> {
> >> >> // Hopefully fixes SIGSEGV error
> >> >> //
> >> >>
> >> >>
> http://stackoverflow.com/questions/6708705/monotouch-sigsegv-crash-using-navigationcontroller-and-searchdisplaycontroller?rq=1
> >> >> BeginInvokeOnMainThread (() => {
> >>
> >> >> searchController.Delegate = null;
> >> >> searchController.SearchResultsDelegate = null;
> >> >> searchController.SearchResultsSource = null;
> >> >> });
> >> >> base.Dispose (disposing);
> >> >> }
> >> >>
> >> >>
> >> >> BeginInvokeOnMainThread will call it and return immediately - so your
> >> >> searchController may have been disposed of by the time the background
> >> >> thread runs.
> >> >>
> >> >> try changing it to either not use the call at all, or use
> >> >> InvokeOnMainThread, which waits for the code to execute before
> >> >> continuing.
> >> >>
> >> >>
> >> >> "Unlike NSObject.BeginInvokeOnMainThread(NSAction) this method waits
> >> >> for the main thread to execute the method, and does not return until
> >> >> the code pointed by action has completed running."
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> On 1 August 2013 09:16, Nordis <[hidden email]> wrote:
> >> >>
> >> >> > I'm having problem to find the cause of random crashes in my app.
> The
> >> >> > crashes
> >> >> > only occurs when I build in release mode and run on a device like
> >> >> > iPhone
> >> >> > or
> >> >> > iPad. Running in debug on simulator no crashes occurs. My guess is
> >> >> > that
> >> >> > the
> >> >> > problem has something to do with these two lines in the crash log,
> >> >> >
> >> >> > 6   UIKit                           0x34a193d0
> >> >> > -[UISearchDisplayController
> >> >> > _destroyManagedTableView] + 68
> >> >> > 7   UIKit                           0x34a2195a
> >> >> > -[UISearchDisplayController
> >> >> > dealloc] + 94
> >> >> > I've uploaded the source code of my UITableViewController and the
> >> >> > full
> >> >> > crash
> >> >> > log here, https://gist.github.com/Nordis/6128735
> >> >> >
> >> >> > All help to track the cause of the crashes is much appreciated!
> >> >> >
> >> >> >
> >> >> >
> >> >> > --
> >> >> > View this message in context:
> >> >> >
> >> >> >
> http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405.html
> >> >> > Sent from the MonoTouch mailing list archive at Nabble.com.
> >> >> > _______________________________________________
> >> >> > MonoTouch mailing list
> >> >> > [hidden email]
> >> >> > http://lists.ximian.com/mailman/listinfo/monotouch
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> Nic Wise
> >> >> t.  <a href="tel:%2B44%207788%20592%20806" value="<a
> >> >> href="tel:%2B447788592806" value="+447788592806"
> >> >> target="_blank">+447788592806"
> >> >> target="_blank"><a href="tel:%2B44%207788%20592%20806"
> >> >> value="+447788592806" target="_blank">+44 7788 592 806 |
> @fastchicken
> >> >> b. http://www.fastchicken.co.nz/
> >>
> >> >> _______________________________________________
> >> >> MonoTouch mailing list
> >> >> [hidden email]
> >> >> http://lists.ximian.com/mailman/listinfo/monotouch
> >> >>
> >> >>
> >> >> ________________________________
> >> >> If you reply to this email, your message will be added to the
> >> >> discussion
> >> >> below:
> >> >>
> >> >>
> >> >>
> http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405p4658406.html
> >> >> To unsubscribe from Crash related to UITableViewController /
> >> >> UISearchDisplayController in MonoTouch/Xamarin.iOS, click here.
> >> >> NAML
> >> >
> >> >
> >> >
> >> > ________________________________
> >> > View this message in context: Re: Crash related to
> UITableViewController
> >> > /
> >> > UISearchDisplayController in MonoTouch/Xamarin.iOS
> >> >
> >> > Sent from the MonoTouch mailing list archive at Nabble.com.
> >> >
> >> > _______________________________________________
> >> > MonoTouch mailing list
> >> > [hidden email]
> >> > http://lists.ximian.com/mailman/listinfo/monotouch
> >> >
> >>
> >>
> >>
> >> --
> >> Nic Wise
> >> t.  <a href="tel:%2B44%207788%20592%20806" value="+447788592806"
> >> target="_blank">+44 7788 592 806 | @fastchicken
> >> b. http://www.fastchicken.co.nz/
> >> _______________________________________________
> >> MonoTouch mailing list
> >> [hidden email]
> >> http://lists.ximian.com/mailman/listinfo/monotouch
> >>
> >>
> >> ________________________________
> >> If you reply to this email, your message will be added to the discussion
> >> below:
> >>
> >>
> http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405p4658408.html
> >> To unsubscribe from Crash related to UITableViewController /
> >> UISearchDisplayController in MonoTouch/Xamarin.iOS, click here.
> >> NAML
> >
> >
> >
> > ________________________________
> > View this message in context: Re: Crash related to UITableViewController
> /
> > UISearchDisplayController in MonoTouch/Xamarin.iOS
> > Sent from the MonoTouch mailing list archive at Nabble.com.
> >
> > _______________________________________________
> > MonoTouch mailing list
> > MonoTouch@lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/monotouch
> >
>
>
>
> --
> Nic Wise
> t.  +44 7788 592 806 | @fastchicken
> b. http://www.fastchicken.co.nz/
>
_______________________________________________
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to