0

I am trying to add nullability to the argument in the method signature. my method declaration look like

(instancetype)initWithNetworkingService(id<NetworkingService>)networkingService;

How do I add nullability to above method ? NetworkingService is a Protocol

  • see this https://stackoverflow.com/questions/29647919/how-to-use-nonnull-and-nullable-objective-c-keywords-in-block-based-api-method – Anbu.Karthik May 25 '17 at 05:18
  • I tried `- (instancetype)initWithNetworkingService: (id) _Nonnull networkingService;` and `- (instancetype)initWithNetworkingService: (nullable id) networkingService;` nothing seems to be working ' – Yash desai May 25 '17 at 05:22

0 Answers0