プロジェクトに新しいフォルダーを作成し、そこにイメージ ("io.jpg" という名前) をコピーしました。
ビルドフェーズも確認しました->バンドルリソースをコピーすると、ファイルがそこにあります。
だから私はこの画像のパスを取得しようとしています:
NSBundle* bundle=[NSBundle mainBundle];
NSString* path=[bundle pathForResource: @"io" ofType: @"jpg"];
NSLog(@"%@",path);
しかし、それは (null) を出力します。私もこの方法を試しました:
NSBundle* bundle=[NSBundle mainBundle];
NSString* path=[bundle pathForImageResource: @"io"];
NSLog(@"%@",path);
しかし、それはまだ (null) を出力します。
どうしたの?