-1

hi after crashing i set the exception break point by pressing break point symbol and i choose objective c language while editing the break point. I run it again ,app is crashed ,but it is not stopped where the exception is occurred in xcode6

Thanks in advance.

  • Follow this answer - http://stackoverflow.com/questions/27505499/detect-array-with-issue-debug-mode/27505675#27505675 – Kampai Dec 19 '14 at 06:14
  • Hi i did same thing what you shown in screen shots .but it is not stopping where the runtime exception is occurred. it always goes to main after crashing. – murali mohan Dec 19 '14 at 06:33

2 Answers2

2

Ok than try using enabling zombie environment.

Follow these steps:

  1. Click on project name and edit scheme.

enter image description here

  1. A pop over will appear, In that select Arguments tab. See bottom section Environment Variables. You can see + button at bottom part. Click on that button and add varialbe NSZombieEnabled with value YES.

enter image description here

  1. Now from same popover select Diagnostics tab. And mark Enable Zombie Objects.

enter image description here

Click close and again run your project, hope this will track down zombie objects at runtime which cause runtime crash.

Kampai
  • 22,848
  • 21
  • 95
  • 95
  • @murali mohan: Try enabling zombie environment to track zombie object. – Kampai Dec 19 '14 at 06:45
  • Thanks for your answer.i tried with enabling zombies.if i give like myarr=[[NSMutableArray alloc]initWithObjects:@"hi", nil]; NSLog(@"myarry object at index 20 %@",[myarr objectAtIndex:20]); it is showing 2014-12-19 12:55:50.077 ExceptionBreakPoint[2840:42450] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 20 beyond bounds [0 .. 0]' But i want which array is rised that exception , i have hundreds of such like arrays. – murali mohan Dec 19 '14 at 07:27
  • What about a simple error detect? Just remove the exception by checking the arrays size before trying to get its content. If the size is smaller then the index you try to access, you can make a log or a breakpoint or whatever you want to debug. – Thallius Dec 19 '14 at 07:32
  • 1
    sorry after cleaning .it is working with exception break point.you are awesome. but what is the need of zombies. – murali mohan Dec 19 '14 at 07:33
  • You will get answer from this thread - http://stackoverflow.com/questions/4168327/what-is-nszombie – Kampai Dec 19 '14 at 07:34
0

See the following steps.

  1. Look into [Navigator] and Click on [Show the Breakpoint Navigator].

  2. See the bottom of Navigator [ + ] Sign. Click on it

  3. Select [Add Exception Breakpoint].

Your Exception Breakpoint are activated from this things.

Sarat Patel
  • 856
  • 13
  • 32