Consider this code:
Task.Factory.StartNew (() => {
try {
Console.WriteLine ("Throwing");
throw new Exception ();
} catch {
Console.WriteLine ("Gotcha!");
}
});
On iOS Simulator, it prints Throwing
and Gotcha!
as expected.
However, when compiled for the device, it only prints Throwing
and never prints Gotcha!
.
Why does this happen?
I'm using MonoTouch 6.0.8.
I can also reproduce it on 6.0.6.
I put up a sample project here, you can try to run it on the device.
(never mind the name—I was investigating a different crash when I found this).