GPB iOS: getParserForType

28 views
Skip to first unread message

Andre

unread,
Feb 18, 2021, 7:32:10 PM2/18/21
to Protocol Buffers
Hello all,

In our Android code, we have the following:

```
val protobufMessage: com.google.protobuf.Message? = protobufsMessageData.protobufGeneratedMessage
datastreamObject = protobufMessage.getParserForType().parseFrom(inputStream)
```

We're creating the equivalent app in iOS, and we're wondering if GPB for iOS has the `getParserForType` function?

Currently, we only see `GPBMessage.parse(from: Data)`
This successfully parses, but it creates a GPBMessage type which we're then NOT able to cast to the object type of our messages.

Is this not possible in iOS protobufs?

We're using the `Protobuf` cocoapod for this app, which is linked to by the Google Protobuf GitHub repo.

Please help.

Cheers,
Andre

Andre

unread,
Mar 1, 2021, 1:23:23 PM3/1/21
to Protocol Buffers
No one else has experienced this?
Reply all
Reply to author
Forward
0 new messages