Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
abd285ae
Commit
abd285ae
authored
8 years ago
by
Makarand Dharmapurikar
Browse files
Options
Downloads
Patches
Plain Diff
Added missing todo and moved _service
To Implementation
parent
dde4fc66
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/objective-c/route_guide/ViewControllers.m
+15
-13
15 additions, 13 deletions
examples/objective-c/route_guide/ViewControllers.m
with
15 additions
and
13 deletions
examples/objective-c/route_guide/ViewControllers.m
+
15
−
13
View file @
abd285ae
...
@@ -80,13 +80,14 @@ static NSString * const kHostAddress = @"localhost:50051";
...
@@ -80,13 +80,14 @@ static NSString * const kHostAddress = @"localhost:50051";
* Run the getFeature demo. Calls getFeature with a point known to have a feature and a point known
* Run the getFeature demo. Calls getFeature with a point known to have a feature and a point known
* not to have a feature.
* not to have a feature.
*/
*/
@interface
GetFeatureViewController
:
UIViewController
{
@interface
GetFeatureViewController
:
UIViewController
RTGRouteGuide
*
_service
;
}
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
outputLabel
;
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
outputLabel
;
@end
@end
@implementation
GetFeatureViewController
@implementation
GetFeatureViewController
RTGRouteGuide
*
_service
;
-
(
void
)
execRequest
{
-
(
void
)
execRequest
{
void
(
^
handler
)(
RTGFeature
*
response
,
NSError
*
error
)
=
^
(
RTGFeature
*
response
,
NSError
*
error
)
{
void
(
^
handler
)(
RTGFeature
*
response
,
NSError
*
error
)
=
^
(
RTGFeature
*
response
,
NSError
*
error
)
{
...
@@ -139,14 +140,14 @@ static NSString * const kHostAddress = @"localhost:50051";
...
@@ -139,14 +140,14 @@ static NSString * const kHostAddress = @"localhost:50051";
* Run the listFeatures demo. Calls listFeatures with a rectangle containing all of the features in
* Run the listFeatures demo. Calls listFeatures with a rectangle containing all of the features in
* the pre-generated database. Prints each response as it comes in.
* the pre-generated database. Prints each response as it comes in.
*/
*/
@interface
ListFeaturesViewController
:
UIViewController
{
@interface
ListFeaturesViewController
:
UIViewController
RTGRouteGuide
*
_service
;
}
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
outputLabel
;
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
outputLabel
;
@end
@end
@implementation
ListFeaturesViewController
@implementation
ListFeaturesViewController
RTGRouteGuide
*
_service
;
-
(
void
)
execRequest
{
-
(
void
)
execRequest
{
RTGRectangle
*
rectangle
=
[
RTGRectangle
message
];
RTGRectangle
*
rectangle
=
[
RTGRectangle
message
];
...
@@ -193,14 +194,14 @@ static NSString * const kHostAddress = @"localhost:50051";
...
@@ -193,14 +194,14 @@ static NSString * const kHostAddress = @"localhost:50051";
* database with a variable delay in between. Prints the statistics when they are sent from the
* database with a variable delay in between. Prints the statistics when they are sent from the
* server.
* server.
*/
*/
@interface
RecordRouteViewController
:
UIViewController
{
@interface
RecordRouteViewController
:
UIViewController
RTGRouteGuide
*
_service
;
}
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
outputLabel
;
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
outputLabel
;
@end
@end
@implementation
RecordRouteViewController
@implementation
RecordRouteViewController
RTGRouteGuide
*
_service
;
-
(
void
)
execRequest
{
-
(
void
)
execRequest
{
NSString
*
dataBasePath
=
[
NSBundle
.
mainBundle
pathForResource
:
@"route_guide_db"
NSString
*
dataBasePath
=
[
NSBundle
.
mainBundle
pathForResource
:
@"route_guide_db"
...
@@ -233,7 +234,7 @@ static NSString * const kHostAddress = @"localhost:50051";
...
@@ -233,7 +234,7 @@ static NSString * const kHostAddress = @"localhost:50051";
NSLog
(
@"It took %i seconds"
,
response
.
elapsedTime
);
NSLog
(
@"It took %i seconds"
,
response
.
elapsedTime
);
}
else
{
}
else
{
NSString
*
str
=
[
NSString
stringWithFormat
:
@"%@
\n
RPC error: %@"
,
self
.
outputLabel
.
text
,
error
];
NSString
*
str
=
[
NSString
stringWithFormat
:
@"%@
\n
RPC error: %@"
,
self
.
outputLabel
.
text
,
error
];
self
.
outputLabel
.
text
=
str
;
self
.
outputLabel
.
text
=
str
;
NSLog
(
@"RPC error: %@"
,
error
);
NSLog
(
@"RPC error: %@"
,
error
);
}
}
}];
}];
...
@@ -261,14 +262,14 @@ static NSString * const kHostAddress = @"localhost:50051";
...
@@ -261,14 +262,14 @@ static NSString * const kHostAddress = @"localhost:50051";
* Run the routeChat demo. Send some chat messages, and print any chat messages that are sent from
* Run the routeChat demo. Send some chat messages, and print any chat messages that are sent from
* the server.
* the server.
*/
*/
@interface
RouteChatViewController
:
UIViewController
{
@interface
RouteChatViewController
:
UIViewController
RTGRouteGuide
*
_service
;
}
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
outputLabel
;
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
outputLabel
;
@end
@end
@implementation
RouteChatViewController
@implementation
RouteChatViewController
RTGRouteGuide
*
_service
;
-
(
void
)
execRequest
{
-
(
void
)
execRequest
{
NSArray
*
notes
=
@[[
RTGRouteNote
noteWithMessage
:
@"First message"
latitude
:
0
longitude
:
0
],
NSArray
*
notes
=
@[[
RTGRouteNote
noteWithMessage
:
@"First message"
latitude
:
0
longitude
:
0
],
...
@@ -305,6 +306,7 @@ static NSString * const kHostAddress = @"localhost:50051";
...
@@ -305,6 +306,7 @@ static NSString * const kHostAddress = @"localhost:50051";
}
}
-
(
void
)
viewDidAppear
:(
BOOL
)
animated
{
-
(
void
)
viewDidAppear
:(
BOOL
)
animated
{
// TODO(makarandd): Set these properties through UI builder
self
.
outputLabel
.
text
=
@"RPC log:"
;
self
.
outputLabel
.
text
=
@"RPC log:"
;
self
.
outputLabel
.
numberOfLines
=
0
;
self
.
outputLabel
.
numberOfLines
=
0
;
self
.
outputLabel
.
font
=
[
UIFont
fontWithName
:
@"Helvetica Neue"
size
:
8
.
0
];
self
.
outputLabel
.
font
=
[
UIFont
fontWithName
:
@"Helvetica Neue"
size
:
8
.
0
];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment