ios - Extracting unknown data from plist -
i'm writing ios loader loads data plist intending send vertex data, etc. gpu via opengl. can extract objects of standard types, strings, integers, etc.
where stumped when encounter appears raw data dictionary object. plist native file saved 3d modeling software, of i'm not author, don't know how data written object.
some things know object, it's array of floats, each vertex needs float value x, y, , z, , there 26 vertices in example below.
here's actual data object in plist file:
<key>vertex</key> <data> aaaaal8aaaaaaaaaaaaaaaaaaac/aaaapwaaaaaaaaa+gaaavwaa ad7ds9caaaaapt2z2l8aaaa+f///aaaaad8aaac/aaaasru9lgaa aaa+3bpxvwaaal6aaaeaaaaapoaaab8aaac+3bpxaaaaalm7vs6/ aaaavwaaaaaaaac+gaadvwaaal7ds9uaaaaavt2z2l8aaac+f//9 aaaaal8aaac/aaaamczelgaaaac+3bpyvwaaad5///0aaaaavn// +l8aaaa+3bpaaaaaad6aaaa/aaaapt2z1waaaaaaaaaapwaaad8a aaaaaaaaaaaaad8aaaaaaaaaaaaaad7ds9g/aaaapn///waaaaa/ aaaapwaaalk7vs4aaaaapt2z1z8aaac+gaabaaaaad6aaae/aaaa vt2z1waaaaczo70upwaaal8aaaaaaaaavoaaaz8aaac+3bpvaaaa al7ds9g/aaaavn///qaaaac/aaaapwaaadhm3i4aaaaavt2z2d8a aaa+f//9aaaaal5///g/aaaapt2z2gaaaaa= </data>
any ideas how read this? here's am:
// plist nsstring *path = [[nsbundle mainbundle] pathforresource:@"cylinder" oftype:@"jas"]; nsdictionary *cheetahfile = [nsdictionary dictionarywithcontentsoffile:path]; nsarray *objectarray = [cheetahfile objectforkey:@"objects"]; nsdictionary *model = [objectarray objectatindex:1]; //get vertex count glshort vertcount = [[model valueforkey:@"vertexcount"] intvalue]; //all far...but... //get vertex data?... doesn't work: nsmutablearray *vertarray = [nsmutablearray arraywithobject:[model objectforkey:@"vertex"]];
p.s. sorry in advance if i'm making rookie mistake. i'm designer profession, not programmer. talk slow using soothing tones while eat crayons. :)
the <data>
part encoded nsdata
object. can this:
nsdata *vertexdata = model[@"vertex"];
what data whole other discussion.
Comments
Post a Comment