what am i doing wrong? i cant get the xmlparser to stop parsing. i set a breakpoint on [xmlParser abortParsing];
and it gets run. but so does everything after if(success)
here is my code:
-(void)viewDidLoad{
[NSThread detachNewThreadSelector:@selector(loadstuff)toTarget:self withObject:nil];
}
-(void)loadstuff{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
xmlParser = [[NSXMLParser alloc] initWithContentsOfURL:url];
XMLParserdelegate *parserdeleagte = [[XMLParserdelegate alloc] init];
[xmlParser setDelegate:parserdelegate];
BOOL success = [xmlParser parse];
if(success){
NSLog(@"No Errors");
links = [[NSMutableArray alloc] initWithArray:links];
titles = [[NSMutableArray alloc] initWithArray:titles];
dates = [[NSMutableArray alloc] initWithArray:dates];
descriptions = [[NSMutableArray alloc] initWithArray:descriptions];
loading = FALSE;
[theTableView reloadData];
}else{
NSLog(@"Error parsing xml");
}
[pool release];
}
-(void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
[xmlParser abortParsing];
[xmlParser release];
xmlParser = nil;
}