0

I have a service in Windows that returns a PDF data, which it's in the database in a varbinary field. This service returns the PDF data as a Byte Array in JSON format
How can I read this data and convert it to PDF again, in my app in Xcode?
Which is the correct structure data to retrieve this byte array? NSArray? NSMutableArray?
I want to store this data, and I'm using a NSData structure...
Thanks

user1600801
  • 269
  • 7
  • 25

1 Answers1

0

An NSArray would be for arrays of objects, you want an array of bytes, which an NSData is.

To get the data out of JSON, you would use the NSJSONSerialization class to extract the data from your JSON object -- the deserializer will probably return your literal data as an NSString, which you then would convert into an NSData by decoding it.

Presumably your raw data is in the JSON as Base64 or some such.

Community
  • 1
  • 1
iluvcapra
  • 9,436
  • 2
  • 30
  • 32