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非常陌生,所以很抱歉,如果这是一个明显的问题。
我喜欢的网站的网址! :)感谢您的信息,我会尽快接受答案! –