持有block
@property (nonatomic, copy) void(^locationBlock)(CLLocation *location);
传参block
- (void)updateLocation:(void(^)(CLLocation *))locationBlock;
调用block
if (self.locationBlock) {
self.locationBlock(locations.firstObject);
self.locationBlock = nil;
}
可用typedef 简化
网友评论