Я добавил файл javascript в свой пакет ресурсов приложения, который мне нужно переместить в каталог документов, но когда я инициирую его путь для копирования, он возвращает ноль.
Код:
NSString *jsPath = [[NSBundle mainBundle] pathForResource:@"jsFile" ofType:@"js"];
NSString *copyPath = [path stringByAppendingString:@"/jsFile.js"]; //path is the documents dir
NSLog(@"%@", jsPath); //Output of this is (null)
if ([[NSFileManager defaultManager] fileExistsAtPath:jsPath]) //returns false
[[NSFileManager defaultManager] copyItemAtPath:jsPath toPath:copyPath error:nil];
Кто-нибудь раньше сталкивался с этим?