-1

When my app starts for the first time it loads the contents of a plist into a sqlite table. I'm using NSThread to run the process but it's throwing an error once the process has completed. The code I use to call the process and run it is as follows -

[NSThread detachNewThreadSelector:@selector(addData) toTarget:self withObject:nil];

-(void)addData
{
   @try {       
      sqlite3_stmt *stmt;
      NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
      [NSThread sleepForTimeInterval:1];
  .
  .
  Process Data
  .
  .
     [pool drain];  
   }
   @catch (NSException *exception) {
   }
}

The error is a SIGABRT error and appears inthe code below -

int main(int argc, char *argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}

I've stepped through the process in Debug and the process finishes ok but a few seconds later it throws this error. It happens in Thread 1 and the code is in Main.m

Could someone please tell me what I am dong wrong.

user616076
  • 3,907
  • 8
  • 38
  • 64
  • Getting SIGABRT and the debugger stopping on UIApplicationMain often happens due to an NSException being raised... in which case some details of the exception will be printed to the debugger console. If looking at said details doesn't solve your problem, reproducing them here might help you get a good answer. (And if you're not seeing debugger output, you might want to try removing your `@try`/`@catch` construct.) – rickster Mar 14 '12 at 17:59
  • If the exception is raised in thread 1, i think that problem is not related with the posted code. – LuisEspinoza Mar 14 '12 at 18:16

1 Answers1

0

To find crash location use debugger as shown in image.! *Add breakpoint using 'All exception breakpoints' in debugger pan.

Image for How to enable exception breakpoints in xcode debugger

Ravin
  • 8,544
  • 3
  • 20
  • 19
  • Thank you all for your replies. I checked in the output from the debugger which was '2012-03-15 09:04:01.472 Poisons[3334:207] -[ViewController updateMyProgressBar]: unrecognized selector sent to instance 0x6846260' I checked the code and found I had a missing procedure. All working fine now. – user616076 Mar 15 '12 at 09:35