pathForImageResource:
画像リソースのパスを返します
-(NSString *)pathForImageResource:(NSString *)name:
解説
画像リソースのパスを返します。
返り値
( NSString * )
パス文字列
引数
( NSString * )name
画像名(拡張子は不要)
フレームワーク
ApplicationKit
クラス
NSBundleAdditions
Instance Methods
使用可能
10.0
参照
例文
NSString *fileName = [[NSBundle mainBundle] pathForImageResource:@"theImage"]; //// #import "SetImage.h" @implementation SetImage - (IBAction)set:(id)sender { NSString *fileName = [[NSBundle mainBundle] pathForImageResource:@"Picture 1"]; NSLog(fileName); } @end