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.