我正在声明这样一个块:
void (^callback)(NSString *_accessToken) = ^{
// do something interesting with _accessToken
}
但是XCode一直告诉我
Incompatible block pointer types initializing void(^__strong)(NSString *__strong)
with an expression of type void (^)(void)
我做错了什么?
答案 0 :(得分:4)
void (^callback)(NSString *) = ^(NSString *_accessToken){
// do something interesting with _accessToken
}