2012-07-08 51 views
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
void (^callback)(NSString *) = ^(NSString *_accessToken){ 
    // do something interesting with _accessToken 
} 
相關問題