initWithScheme:host:path:
スキーム、ホストとパスでURLとして新しくつくられたNSURLを初期化して返します
-(id)initWithScheme:(NSString *)scheme: host:(NSString *)host: path:(NSString *)path:
解説
スキーム、ホストとパスでURLとして新しくつくられたNSURLを初期化して返します。
スキームはhttpやftpなどプロトコルの種類です。
ホストはwww.apple.comやwww.oomori.comなどです。
パスはindex.htmlやdefault.htmlなどです。
返り値
( id )
NSURL
引数
( NSString * )scheme
スキーム
( NSString * )host
ホスト
( NSString * )path
パス
フレームワーク
Foundation
クラス
NSURL
Instance Methods
使用可能
10.0
参照
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSURL *url = [NSURL URLWithString:@""]; [url initWithScheme:@"http" host:@"www.oomori.com" path:@"/index.html"]; [info setStringValue:[url absoluteString]]; } @end