GPB iOS: getParserForType

21 zobrazení
Přeskočit na první nepřečtenou zprávu

Andre

nepřečteno,
18. 2. 2021 19:32:1018.02.21
komu: 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

nepřečteno,
1. 3. 2021 13:23:2301.03.21
komu: Protocol Buffers
No one else has experienced this?
Odpovědět všem
Odpověď autorovi
Přeposlat
0 nových zpráv