【发布时间】:2012-03-16 07:15:40
【问题描述】:
这听起来可能是一个新手问题,但我是 iOS 开发新手。
arg1 和 arg2 在以下代码中的 completionHandler 块中是否可见?如果不是,将这些变量传递给块的正确方法是什么?
- (void)addCurrentLocationNameToDB:(CLLocation *)location param1:(NSString*)arg1 param2:(NSString*)arg2
{
CLGeocoder * geoCoder = [[CLGeocoder alloc] init];
[geoCoder reverseGeocodeLocation:location completionHandler:^(NSArray *placemarks, NSError *error)
{
[self locationNameDidReceive:locationName forLocation:location forTrip:arg1 waypoint:arg2];
}];
}
【问题讨论】:
标签: iphone objective-c ios scope block