0
我需要使用http請求的結果執行重複任務,因此想要將完成hander的聲明存儲在變量中(或者以某種方式將其聲明爲函數可以通過)。變量iOS中的存儲完成處理程序(目標c)
示例代碼:
[NSURLConnection sendAsynchronousRequest:request
queue:[NSOperationQueue mainQueue]
completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
// carry out some action
}];
我想能夠寫
[NSURLConnection sendAsynchronousRequest:request
queue:[NSOperationQueue mainQueue]
completionHandler: standardHandler ];
凡standardHandler含有嵌段功能。
這可能嗎?
我對Objective C非常陌生,所以很抱歉,如果這是一個明顯的問題。
我喜歡的網站的網址! :)感謝您的信息,我會盡快接受答案! –