NSBundle *thisBundleb = [NSBundle mainBundle];
pathb = [thisBundleb pathForResource:[a3 objectAtIndex:0] ofType:@"html"];
NSURL *instructionsURLb = [[NSURL alloc] initFileURLWithPath:pathb];
[webView loadRequest:[NSURLRequest requestWithURL:instructionsURLb]];
value of [a3 objectAtIndex:0]=index but when i pass like this i am getting
* Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘* -[NSURL initFileURLWithPath:]: nil string parameter’**
What I am doing wrong?
pathForResource:ofType: is returning nil, and initFileURLWithPath: is complaining about it. Trap that error like so:
and double check that you’re searching for an object that actually exists in your bundle.