I am using xml parser in my application. When i run my application for 10 to 15 time its works fine but suddenly its giving me the bad_access with above codes. My xml parser code as follow:
-(BOOL)getTheServerStatus:(NSData *)webData
{
if (webData==NULL)
{
return FALSE;
}
parser=[[NSXMLParser alloc]initWithData:webData];
[parser setDelegate:self];
[self performSelectorOnMainThread:@selector(parseData:)
withObject:webData
waitUntilDone:YES];
if([strVal isEqualToString:@"ok"])
{
return TRUE;
}
else
{
return FALSE;
}
}
- (void)parseData:(NSData *)webData
{
if(webData==NULL)
{
NSLog(@"web data is NULL");
}
[parser parse];
}
I am using automatic reference counting .So what is the issue with my code?