2

我正在声明这样的块:

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)

我究竟做错了什么?

4

1 回答 1

4
void (^callback)(NSString *) = ^(NSString *_accessToken){
  // do something interesting with _accessToken
}
于 2012-07-08T19:54:36.100 回答