小编use*_*344的帖子

在方法调用中的插入符号

我正在阅读本教程并遇到了这行代码,这让我很难过:

[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) {

那个插入符号 ^ 和之后发生的事情是我不知道的.

我查看了一些文档但找不到任何内容.

objective-c ios

2
推荐指数
1
解决办法
146
查看次数

标签 统计

ios ×1

objective-c ×1