objective c - Using nullability with block based APIs -


i have api

+ (void)getthething:(nonnull void (^)(nsstring * __nullable thing, nserror * __nullable error))completion;

(syntax taken here)

but when go use it, , take advantage of xcode's block autocomplete, autocompletes this:

[myapi getthething:^nonnull void(nsstring * __nullable, nserror * __nullable) {     <#code#>  }]; 

which gives errors nonnull being not recognised, fact there's not argument names etc...

any idea what's going on? :s declaring wrong? stuff new, , documentation isn't complete :/

any idea what's going on?

it broken http://www.openradar.me/20835509

am declaring wrong?

you annotate blocks this:

+ (void)getthething:(void (^__nonnull)(nsstring * __nullable thing, nserror * __nullable error))completion;

then autocomplete produce code:

[myapi getthething:^(nsstring * __nullable, nserror * __nullable) {     <#code#>  }]; 

it still broken though. faster forget autocomplete , copy , paste block declaration.

this stuff new, , documentation isn't complete

there more info on llvm website, still not enough info on blocks.


Comments