ios - How to read binary data stored in NSData -


i getting data web call. here data.

00000001 00045043 4c4e0000 00023744 92f4cd44 92f4cd44 92f4cd44 92f4cd3c a3d70a00 00014de2 b767a044 93800044 93800044 93800044 93800040 a0000000 00014de2 bdd04044 94400044 94400044 93db3344 94170a3f a6666600 00014de2 c8ccc044 93ddc344 93ddc344 93ddc344 93ddc33e 99999a00 00014de2 ce4b0044 93bd1f44 943d7144 9394cd44 93eccd41 e8e14800 00014de2 d01fc044 93eb3344 93eb3344 93b00044 93b00040 c0000000

the data format fixed (we know stores int / float etc.

question how read , store in individual variables example first 4 bytes here specifying number of symbols returned (1)

nsdata has method func getbytes(buffer: unsafemutablepointer<void>, range: nsrange) should you. can grab each thing in struct specifying range.

so can do:

var length: int = 0 mydata.getbytes(&length, range: nsmakerange(0, 4)) 

and on each type, range need


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -