relativePath
関連パスを返します
解説
関連パスを返します。baseURLがnilなら絶対パスです。
http://www.oomori.com/aaa/bbb.html?ccc=123の場合、/aaa/bbb.htmlが返されます。
RFC1808に合っていなければnilを返します。
返り値
( NSString * )
関連パス
引数
フレームワーク
Foundation
クラス
NSURL
Instance Methods
使用可能
10.0
参照
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSURL *url = [NSURL URLWithString:@"http://www.oomori.com/index.html#123?id=123"]; NSString *string = [[[NSString alloc] init] autorelease]; string = [url relativePath]; if (string != nil){ [info setStringValue:string]; }else{ [info setStringValue:@"Nil"]; } } @end