2012-03-16 56 views
0

這聽起來可能是一個新手問題,但我是iOS開發新手。塊處理程序中變量的可見性(範圍)

是否arg1arg2completionHandler塊中可見,在下面的代碼中?如果不是將這些變量傳遞給塊的正確方法是什麼?

- (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]; 
    }]; 
} 

回答