Make multiple -init and +new UNAVAILABLE; identify designated initializer

pull/16190/head
Muxi Yan 6 years ago
parent 553664f59b
commit 5715719afb
  1. 6
      src/objective-c/GRPCClient/GRPCCall.h
  2. 12
      src/objective-c/ProtoRPC/ProtoRPC.h
  3. 4
      src/objective-c/ProtoRPC/ProtoService.h

@ -190,8 +190,10 @@ extern id const kGRPCTrailersKey;
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
/** Initialize with all properties. */
- (instancetype)initWithHost:(NSString *)host path:(NSString *)path safety:(GRPCCallSafety)safety;
- (instancetype)initWithHost:(NSString *)host path:(NSString *)path safety:(GRPCCallSafety)safety NS_DESIGNATED_INITIALIZER;
/** The host serving the RPC service. */
@property(copy, readonly) NSString *host;
@ -214,6 +216,8 @@ extern id const kGRPCTrailersKey;
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
/**
* Designated initializer for a call.
* \param requestOptions Protobuf generated parameters for the call.

@ -26,6 +26,10 @@
/** A unary-request RPC call with Protobuf. */
@interface GRPCUnaryProtoCall : NSObject
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
/**
* Users should not use this initializer directly. Call objects will be created, initialized, and
* returned to users by methods of the generated service.
@ -34,7 +38,7 @@
message:(GPBMessage *)message
responseHandler:(id<GRPCResponseHandler>)handler
callOptions:(GRPCCallOptions *)callOptions
responseClass:(Class)responseClass;
responseClass:(Class)responseClass NS_DESIGNATED_INITIALIZER;
/** Cancel the call at best effort. */
- (void)cancel;
@ -44,6 +48,10 @@
/** A client-streaming RPC call with Protobuf. */
@interface GRPCStreamingProtoCall : NSObject
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
/**
* Users should not use this initializer directly. Call objects will be created, initialized, and
* returned to users by methods of the generated service.
@ -51,7 +59,7 @@
- (instancetype)initWithRequestOptions:(GRPCRequestOptions *)requestOptions
responseHandler:(id<GRPCResponseHandler>)handler
callOptions:(GRPCCallOptions *)callOptions
responseClass:(Class)responseClass;
responseClass:(Class)responseClass NS_DESIGNATED_INITIALIZER;
/** Cancel the call at best effort. */
- (void)cancel;

@ -30,6 +30,10 @@
__attribute__((deprecated("Please use GRPCProtoService."))) @interface ProtoService
: NSObject
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
-
(instancetype)initWithHost : (NSString *)host packageName
: (NSString *)packageName serviceName : (NSString *)serviceName callOptions

Loading…
Cancel
Save