aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Muxi Yan <muxi@users.noreply.github.com>2018-05-03 16:42:21 -0700
committerGravatar GitHub <noreply@github.com>2018-05-03 16:42:21 -0700
commit3ec172fd377216646a675d49b21bb6d09fc75e98 (patch)
treea34d6850f3f8752a30986107c59eb25f4a277af1 /src
parent6a14efc0236d8ff723c662305b5e7dac7f0cf491 (diff)
parent77933b1897af206fc7722c53a07833d947ca45f3 (diff)
Merge pull request #15262 from grpc/revert-15258-revert-15193-service-init-protocol
Revert "Revert "Provide protocol for initializer of generated messages""
Diffstat (limited to 'src')
-rw-r--r--src/compiler/objective_c_generator.cc3
-rw-r--r--src/objective-c/ProtoRPC/ProtoService.h6
2 files changed, 8 insertions, 1 deletions
diff --git a/src/compiler/objective_c_generator.cc b/src/compiler/objective_c_generator.cc
index 39f68cb956..e97494f64c 100644
--- a/src/compiler/objective_c_generator.cc
+++ b/src/compiler/objective_c_generator.cc
@@ -222,7 +222,8 @@ void PrintMethodImplementations(Printer* printer,
map< ::grpc::string, ::grpc::string> vars = {
{"service_class", ServiceClassName(service)}};
- printer.Print(vars, "@protocol $service_class$ <NSObject>\n\n");
+ printer.Print(
+ vars, "@protocol $service_class$ <NSObject, GRPCProtoServiceInit>\n\n");
for (int i = 0; i < service->method_count(); i++) {
PrintMethodDeclarations(&printer, service->method(i));
}
diff --git a/src/objective-c/ProtoRPC/ProtoService.h b/src/objective-c/ProtoRPC/ProtoService.h
index 29c4e9be36..c411bed60f 100644
--- a/src/objective-c/ProtoRPC/ProtoService.h
+++ b/src/objective-c/ProtoRPC/ProtoService.h
@@ -22,6 +22,12 @@
@protocol GRXWriteable;
@class GRXWriter;
+@protocol GRPCProtoServiceInit
+
+- (instancetype)initWithHost:(NSString *)host;
+
+@end
+
__attribute__((deprecated("Please use GRPCProtoService."))) @interface ProtoService
: NSObject -
(instancetype)initWithHost : (NSString *)host packageName