Quantcast
Channel: Questions in topic: "exception"
Viewing all articles
Browse latest Browse all 470

C# try catch block doesn't work for iOS?

$
0
0
Trying to build an app to iOS, & to my surprise it seems code in a standard C# try-catch block hangs the build. Does try-catch work in an iOS build? I hope I can post code here properly (first time), but the offending code is: try { xmlDoc.LoadXml(xmlDocString); try { steering = float.Parse(xmlDoc.DocumentElement.Attributes["steering"].Value); } catch { steering = 0f; } } catch { } It hangs on the inner try catch block. I nested the try-catch blocks to isolate the problem. xmlDoc is an XmlDocument object that loads an XML string sent via a SendMessage (so the string is cast from type object). I understand an exception may occur because the XML string may not contain the attribute. But isn't try-catch supposed to handle this kind of exception handling? Does Android build have the same issue? Any info welcome & appreciated. Thanks.

Viewing all articles
Browse latest Browse all 470

Trending Articles



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