Calling Blocks
Posted: Tue Mar 29, 2016 5:25 pm
I use NSURLSession in my app and I need to set it up so that it does not follow redirects. The only way is to provide a delegate for:
https://developer.apple.com/library/mac ... onHandler:
Now, I have a completionHandler block as a parameter and I need to call it with a Null parameter (to tell it not to follow the redirects).
I haven't found an example of how to call blocks provided by the AppKit.
Anyone can help? Thank you in advance.
https://developer.apple.com/library/mac ... onHandler:
Code: Select all
- (void)URLSession:(NSURLSession *)session
task:(NSURLSessionTask *)task
willPerformHTTPRedirection:(NSHTTPURLResponse *)response
newRequest:(NSURLRequest *)request
completionHandler:(void (^)(NSURLRequest *))completionHandler
I haven't found an example of how to call blocks provided by the AppKit.
Anyone can help? Thank you in advance.