According to the docs, the method returns nil
if the file cannot be found. The conclusion, therefore, is that the file is missing. Check your project's Build Phases/Copy Bundle Resources to ensure that the file is actually present because in all likelihood it is not.
document Path is showing nil for .doc file but working for .txt objective c cocoa
-
13-07-2023 - |
Vra
I am using below code
// it is showing nil for path
NSString *path = [[NSBundle mainBundle] pathForResource:@"filetext.doc" ofType:nil];
NSURL *url1 = [NSURL fileURLWithPath:path];
// it is showing working
NSString *path = [[NSBundle mainBundle] pathForResource:@"filetext.txt" ofType:nil];
NSURL *url1 = [NSURL fileURLWithPath:path];
Please help what is the issue
Oplossing
Gelisensieer onder: CC-BY-SA met toeskrywing
Nie verbonde aan StackOverflow