declaring a typed NSMutableDictionary of blocks

I would like to define a typed nsmutable dictionary that contains blocks.

I cannot get the right syntax.

The closes I can get is

@property (nonatomic) NSMutableDictionary<Keys*,(void(^)(NSError* _Nullable error))>* completionBlocks;

but it says I need a type. I tried many formats for the block but I just cannot get it

thanks :-)

1 answer

  • answered 2017-08-12 10:13 Torongo

    Just remove the brackets. Try this

    @property (nonatomic) NSMutableDictionary<Keys*,void(^)(NSError* _Nullable error)>* completionBlocks;