這段代碼是什麼意思?dispatch_async和iOS中的塊
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
TMBaseParser *parser=[[TMBaseParser alloc] init];
parser.delegate=self;
NSString *post =nil;
NSData *postData = [post dataUsingEncoding:NSUTF8StringEncoding];
[parser parseForServiceType:TMServiceCategories postdata:postData];
});
請解釋一下
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
});
briefly.Thanks
該代碼看起來奇怪:第一'POST'設置爲'nil'。在下一行中,一條消息被髮送到'post'。那什麼都不會做,是嗎? – Maarten
如果post == nil,那麼[post dataUsingEncoding:NSUTF8StringEncoding]也會返回nil。 – ahwulf