Quantcast
Channel: Questions in topic: "ios"
Viewing all articles
Browse latest Browse all 4709

Strange behavior while running in Xcode: error only when "Development Build" is unchecked

$
0
0
My game runs smoothly on editor and on device (iPhone/iPod), but when I debug in Xcode I got EXC_BAD_ACCESS exceptions only if "Development Build" option in Build Settings of Unity is unchecked. I don't understand what is the real effect of "Development Build" option in this scenario. I got errors in Xcode even in handled exception inside a try/catch, but only if "Development Build" option is off. Example: //NOTE: gL object is NULL and so the code will raise an exception void Start () { try { GameLevel gL = ApplicationData.AllLevels.Find(delegate(GameLevel obj) {return obj.Level == 1000;}); // gL = null string test = gL.LevelName; } catch(Exception ex) { Debug.Log(ex.ToString()); } } In the console output as expected I have: System.NullReferenceException: Object reference not set to an instance of an object … But when this code runs in Xcode debugger, with "Development Build" option unchecked, it seems like the exception simply is not handled and I got an EXC_BAD_ACCESS. I highlight that this happens only when "Development Build" is unchecked. Any idea about why this happens and how to avoid it? I use Unity 4.3.4 and Xcode 5.1.1

Viewing all articles
Browse latest Browse all 4709

Trending Articles



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