我了解块对象是如何工作的 - 但我还没有碰到过这种类型的块对象的到来,林不知道下面的代码做什么:块对象需要进一步解释
[localSearch startWithCompletionHandler:^(MKLocalSearchResponse *response, NSError *error) {
if (!error) {
int i = 0;
do {
MKMapItem *mapItem = [response.mapItems objectAtIndex:i];
[self.mapItems addObject:mapItem];
i++;
} while (i < response.mapItems.count);
[[NSNotificationCenter defaultCenter] postNotificationName:@"Address Found" object:self];
} else {
[[NSNotificationCenter defaultCenter] postNotificationName:@"Not Found" object:self];
}
}];
}
我将是巨大的,如果有人能提供关于这里发生了什么的解释。
如果你“了解块对象是如何工作的”,那么你究竟在这里不了解什么? –