我正在阅读本教程并遇到了这行代码,这让我很难过:
[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];
}
}];
Run Code Online (Sandbox Code Playgroud)
我不理解的部分如下: ^(MKLocalSearchResponse *response, NSError *error) {
那个插入符号 ^ 和之后发生的事情是我不知道的.
我查看了一些文档但找不到任何内容.