2016-07-01 2 views

Antwort

0

Sie können Blockparameter verwenden, um Wert in Block zurückzugeben, dann laden Sie diese Anforderung in Abschlussbehandlungsblock.

+ (void)canonicalRequestForRequest:(NSURLRequest *)request completionHandler:(void (^)(NSURLRequest *request))completionHandler { 
// Here is an asynchronous method which gives a NSString by using a block. 
// I need to convert this NSString back to NSURLRequest, 
// so the webview can load the content. 


    // call completionHandler inside of asynchronous block 
    completionHandler(returnRequest); 
} 
+0

Seit + (NSURLRequest *) canonicalRequestForRequest: (NSURLRequest *) Anfrage: ist Methode von der abstrakten Klasse NSURLProtocol, ich denke, das dont't ein solution.https: //developer.apple.com/library /mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLProtocol_Class/index.html#//apple_ref/occ/clm/NSURLProtocol/canonicalRequestForRequest: – Gavin

Verwandte Themen