My Application is crashes in the device at this point,
[[NSBundle mainBundle] pathForResource
I am giving the path for the pdf here . but at the execution time it is showing that it is not getting path there . and that may be the reason for crashing.
however it is running perfectly on simulator .
i am not able to figure out why is this happening
here is that code
NSString *path = [[NSBundle mainBundle] pathForResource:[myArray objectAtIndex:0] ofType:[myArray objectAtIndex:1]];
NSLog(@"array elemt :%@", [myArray objectAtIndex:0]);
NSLog(@"ar开发者_运维技巧ray elemt 1 :%@", [myArray objectAtIndex:1]);
NSLog(@"path is :%@",path);
NSLog(@"responds to selector mainBundle=%@",[NSBundle respondsToSelector:@selector(mainBundle)]?@"YES""NO");
NSURL *targetURL = [NSURL fileURLWithPath:path];
in this log of the path - when i use device it is showing me nil
and when i use simulator it is showing me the path . and it is showing me that is is crashing on NSURL
line
I've found that when something like this works on the simulator, but not on the device, it's likely a problem with the case of the string. Your device is case sensitive but not your computer. Check your string of the file name or the type.
精彩评论