I am building an iPad application, based on HTML and I am loading the HTML from local files. In those files I need the jQuery library, so I have the js file in my project and I'll load it using stringByEvaluatingJavaScriptFromString or something like this - this is irrelevant for now.
When I use the following code the NSLog returns null:
NSString *gameFileContents = [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"jquery172" ofType:@"js"] encoding:NSASCIIStringEncoding error:nil];
NSLog(@"%@",gameFileContents);
When I change only the extension of the file from .js to .json everything is fine.
NSString *gameFileContents = [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"jquery172" ofType:@"json"] encoding:NSASCIIStringEncoding error:nil];
NSLog(@"%@",gameFileContents);
Are there any restrictions on the extensions of the files? I can use the file like that, but it does not seem right - I like everything to be in place.