- Home /
Strange behavior while running in Xcode: error only when "Development Build" is unchecked
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
Your answer
Follow this Question
Related Questions
Linker error - Unity on iOS/React Native project 1 Answer
Project not pushing to Android or iOS 1 Answer
Problems Unity to Xcode? 2 Answers
Unity + XCode Problem (really wierd) 0 Answers
Problems when building using Xcode 0 Answers