loadResourceDataNotifyingClient:usingCache:
バックグラウンドでレシーバのリソースデータをロードします
-(void)loadResourceDataNotifyingClient:(id)client: usingCache:(BOOL)shouldUseCache:
解説
バックグラウンドでレシーバのリソースデータをロードします。クライアントはNSURLHandleClientインフォーマルプロトコルを使います。
返り値
( void )
なし
引数
( id )client
クライアント
( BOOL )shouldUseCache
キャッシュを使うか
フレームワーク
Foundation
クラス
NSURL
Instance Methods
使用可能
10.0
参照
例文
#import "MyObject.h" @implementation MyObject //リソースデータ読み込みできる - (void)URL:(NSURL *)sender resourceDataDidBecomeAvailable:(NSData *)newBytes { NSLog(@"resourceDataDidBecomeAvailable"); } //リソースデータ読み込み終了 - (void)URLResourceDidFinishLoading:(NSURL *)sender { NSLog(@"URLResourceDidFinishLoading"); } // - (void)URLResourceDidCancelLoading:(NSURL *)sender { NSLog(@"URLResourceDidCancelLoading"); } // - (void)URL:(NSURL *)sender resourceDidFailLoadingWithReason:(NSString *)reason { NSLog(@"resourceDidFailLoadingWithReason"); } - (void)URLHandle:(NSURLHandle *)sender resourceDataDidBecomeAvailable:(NSData *)newBytes { NSLog(@"resourceDataDidBecomeAvailable"); } - (void)URLHandleResourceDidBeginLoading:(NSURLHandle *)sender { NSLog(@"URLHandleResourceDidBeginLoading"); } - (void)URLHandleResourceDidFinishLoading:(NSURLHandle *)sender { NSLog(@"URLHandleResourceDidFinishLoading"); } - (void)URLHandleResourceDidCancelLoading:(NSURLHandle *)sender { NSLog(@"URLHandleResourceDidCancelLoading"); } - (void)URLHandle:(NSURLHandle *)sender resourceDidFailLoadingWithReason:(NSString *)reason { NSLog(@"resourceDidFailLoadingWithReason"); } - (IBAction)myAction:(id)sender { NSURL *url = [NSURL URLWithString:@""]; [url initWithScheme:@"http" host:@"www.oomori.com" path:@"/index.html"]; [url loadResourceDataNotifyingClient:self usingCache: NO]; [info setStringValue:[url absoluteString]]; } @end