Buttons Crash in Debug, but not when Out of Debug

Hi

In my app i have three buttons that are activated using the following code. (They’re texture gameObjects):

function Update () {

	var ray = Camera.main.ScreenPointToRay (Input.mousePosition);

		if(Input.touchCount > 0)		
		{
				var touch: Touch = Input.touches[0]; 
						
			
			//Play Game
			if (touch.phase == TouchPhase.Began  Physics.Raycast (ray, hit, 100)  hit.transform.name == btn_Play.name) { 
				
				Application.LoadLevel("Game_RankMode");
				Debug.Log("PLAY");
			}	
   ...and so forth.....

When I build and run through Xcode debug, I always get a GDB error whenever I press one of the buttons. The error gives my no other detail, but points me to Thread 1: Program Received Signal: “EXC_BAD_ACCESS” under “Boo_Lang_Runtime_RuntimeServices_Displatch_object_string_System_Type__object__Boo_Lang_Runtime_DynamicDispatchinerCache_DispatcherFactory…”

I have no idea what any of the above means lol

However, if I play the app when not going through debug, the buttons are just fine - no crashes, and the buttons behave as intended.

What could this mean?

Thanks for the advice.

Just an update - i used the onMouseDown version of this script and it works perfectly without issues. So I figure it’s an XCode issue? I’m using latest Xcode on a 3GS with 5.0 installed. It’s also crashing on my iPod that’s still running on the previous iOS version.

And if it’s not Xcode, then must be my touch code? But I can’t see how or where as i’ve used this exact code in other apps without issues