I'm new to IOS I need to implement NSThread in my program, but when it invoked it shows an SIGABRT error. my current code is given below
XMLParser.m
-(void)loadXML
{
categories =[[NSMutableArray alloc]init];
NSString *filepath =[[NSBundle mainBundle]pathForResource:@"cd_catalog" ofType:@"xml"];
NSData *data =[NSData dataWithContentsOfFile:filepath];
parser=[[NSXMLParser alloc]initWithData:data];
parser.delegate =self;
[parser parse];
}
ViewController.m
- (void)viewDidLoad
{
xmlParser =[[XMLParser alloc]init];
NSThread *myThread =[[NSThread alloc]initWithTarget:self selector:@selector(loadXML) object:nil];
[myThread start];
[super viewDidLoad];
}
please tell me what is wrong with my program