In my app I have to read an XML file and display it in a UITextView. To do this I tried the code below. This code is resulting in a crash; can any one tell me the exact mistake? I hope I wrote well. Please help me out. Thank you.
-(IBAction)xmlParse{
NSString *xmlPath=[[[[UIApplication sharedApplication]delegate] applicationDocumentDirectory]stringByAppendingPathComponent:@"xmlFile/toc.xml"];
NSError *error=nil;
NSString *fileContent=[NSString stringWithContentsOfFile:xmlPath usedEncoding:NSASCIIStringEncoding error:NULL];
xmlDisplay.text=fileContent;
}
replace
with
you should not ignore the
assing argument 2 of 'stringWithContentsOfFile:usedEncoding:error:' makes pointer from integer without a castwarning the compiler shows you.