0
私はバンドルにいくつかの問題を抱えていて、何とかバンドルからdocsディレクトリにイメージを保存できなくなりました。文書NSBundle.hを保存することができません
をNSBundle.hはありません は、それは明らかにうまくコンパイル
を保存することができ、ドキュメント:今私はビルドする前に、このエラーを持っています。事前にあなたの助けのための
//Get every name from plist array and append it to the full path
for(NSString *aName in namesPackage) {
bundlePath = [[NSBundle mainBundle] pathForResource:aName ofType:@"png"];
if([fileManager fileExistsAtPath:bundlePath])NSLog(@"it exists in bundle: %@",bundlePath);
imagePath = [NSString stringWithFormat:@"%@/%@/%@",DOCUMENTS_FOLDER,package,aName];
[fileManager copyItemAtPath:bundlePath toPath:imagePath error:&anError];
if(anError) NSLog([anError description]);
}
ありがとう: これは私が使用しているコードの一種です。
は、末尾のスラッシュで任意の潜在的な問題の世話をする-stringByAppendingPathComponent:
-stringByAppendingPathExtension:
など
また、あなたはのように未知の文字列を渡すことはありません:
NSBundleヘッダファイルで何とか変更してしまいましたが、Xcodeがそれを保存しようとしていました – Carlos
どのようなランタイムエラーやNSLog出力が表示されていますか? – fbrereto