I'm grabbing data from an external file using NSURL with the code below. If i wanted to grab this data from an internal file in my resources folder how would the code be different.
here's the NSURL code:
NSURL *dataUrl = [NSURL URLWithString:@"https://sites.google.com/site/*****/***/file.asc"]; NSString *fileString = [NSString stringWithContentsOfURL:dataUrl encoding:NSUTF8StringEncoding error:nil];
this was my attempt:
NSString *path = [[NSBundle mainBundle] pathForResource:@"fileName" ofType:@"asc"]; NSString *fileString = [NSString initWithContentsOfFile:path];
thanks in advance
Maybe try
stringByExpandingTildeInPath
something like