我有以下代码,由于某种原因,我的块没有被触发。
int main (int argc, const char * argv[])
{
@autoreleasepool {
return 0;
HttpRequestHelper *requestHelper = [[HttpRequestHelper alloc] init];
[requestHelper processRequest:@"www.yahoo.com" callback:^(NSString * response) {
NSLog(@"%@",response);
}];
}
}
@implementation HttpRequestHelper
-(void) processRequest:(NSString *)url callback:(void (^)(NSString *))block
{
block(url);
}