我的应用程序是在这一点上的设备崩溃,应用程序崩溃,在[[一个NSBundle mainBundle] pathForResource
[[NSBundle mainBundle] pathForResource
我给的路径为PDF格式在这里。但在执行时它表明它没有在那里获得路径。这可能是导致崩溃的原因。但是它在模拟器上运行完美。
我不能够弄清楚这究竟是为什么
这里是在该日志路径的代码
NSString *path = [[NSBundle mainBundle] pathForResource:[myArray objectAtIndex:0] ofType:[myArray objectAtIndex:1]];
NSLog(@"array elemt :%@", [myArray objectAtIndex:0]);
NSLog(@"array elemt 1 :%@", [myArray objectAtIndex:1]);
NSLog(@"path is :%@",path);
NSLog(@"responds to selector mainBundle=%@",[NSBundle respondsToSelector:@selector(mainBundle)][email protected]"YES""NO");
NSURL *targetURL = [NSURL fileURLWithPath:path];
- 当我使用设备,它显示我nil
当我使用它向我展示了模拟器的路径。它显示我正在崩溃NSURL
线
你可以发表一些代码吗? –
编辑......... –
你能告诉我们数组元素0和1是什么吗?也许我可以从那里找出错误 –