Titanium JSON Story

Titanium JSON Story

Titanium / Objective-C JSON, Object processing experiment

Dd17014e380450cfed5d55ff20fa3dfd?s=128

Ryutaro Miyashita

October 09, 2013
Tweet

Transcript

  1. { } +40/෺ޠ 5JUBOJVN+40/4UPSZ "desc": "title": 5JUBOJVN΋͘΋͘ձ5PLZP JO0QFO/FUXPSL4QBDF ͋ͱϞδϡʔϧ

  2. 3ZVUBSP.JZBTIJUB BLBSZVHPP $IBU8PSL  SZVHPP@  SZVHPP 5JUBOJVN΋͘΋͘ձ5PLZP JO0QFO/FUXPSL4QBDF

  3. 5JUBOJVN΋͘΋͘ձ5PLZP JO0QFO/FUXPSL4QBDF +40/ +BWB4DSJQU0CKFDU/PUBUJPO

  4. { "glossary": { "title": "example glossary", "GlossDiv": { "title": "S",

    "GlossList": { "GlossEntry": { "ID": "SGML", "SortAs": "SGML" "GlossTerm": "St "Acronym": "SGML "Abbrev": "ISO 8 "GlossDef": { +40/ KTPOPSHFYBNQMFIUNM
  5. 4JNQMF -JHIU &BTZ γϯϓϧͰܰͯ͘࢖͍΍͍͢ 5JUBOJVN΋͘΋͘ձ5PLZP JO0QFO/FUXPSL4QBDF

  6. 5JUBOJVN+40/ 5JUBOJVNͱ+40/ 5JUBOJVN΋͘΋͘ձ5PLZP JO0QFO/FUXPSL4QBDF

  7. +40/QBSTF 5JUBOJVN΋͘΋͘ձ5PLZP JO0QFO/FUXPSL4QBDF +40/TUSJOHJGZ

  8. +40/QBSTF 5JUBOJVN΋͘΋͘ձ5PLZP JO0QFO/FUXPSL4QBDF จࣈྻΛΦϒδΣΫτʹ͢Δ

  9. ΦϒδΣΫτΛจࣈྻʹ͢Δ 5JUBOJVN΋͘΋͘ձ5PLZP JO0QFO/FUXPSL4QBDF +40/TUSJOHJGZ

  10. 5JUBOJVN΋͘΋͘ձ5PLZP JO0QFO/FUXPSL4QBDF ศར

  11. 5JUBOJVN΋͘΋͘ձ5PLZP JO0QFO/FUXPSL4QBDF 0CKFDUJWF$+40/ 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5PLZP JO0QFO/FUXPSL4QBDF for  (var  i  =  0;  i  <  1000;

     i++)  {    //  Method  Call  Bottleneck } ϝιουݺͼग़͠ͷϘτϧωοΫ
  23. 5JUBOJVN΋͘΋͘ձ5PLZP JO0QFO/FUXPSL4QBDF {        "1":  "abcde",    

       "2":  "abcde",        "3":  "abcde",        "4":  "abcde",        ...        "1000":  "abcde" } GPSJO +4 0CKFDUJWF$ 'BTU &OVNFSBUJPO ʷ
  24. 5JUBOJVN΋͘΋͘ձ5PLZP JO0QFO/FUXPSL4QBDF GPSJO +4 0CKFDUJWF$ 'BTU &OVNFSBUJPO for  (var  key

     in  obj)  {    if  (obj.hasOwnProperty(key))  {        obj[key];    } } -­‐(void)dictEnumerator:(id)args {    ENSURE_SINGLE_ARG(args,  NSDictionary);    for  (id  i  in  [args  keyEnumerator])  {        args[i];    } }
  25. 5JUBOJVN΋͘΋͘ձ5PLZP JO0QFO/FUXPSL4QBDF 'BTU &OVNFSBUJPO NT NT GPSJO NT NT +4

    0CK$ ʷ ʷ ʷ ʷ
  26. Ϟδϡʔϧݺͼग़͠ ஗͍ʁ .PEVMFNFUIPEDBMMJTTMPX ΋͔ͯ͠͠ 5JUBOJVN΋͘΋͘ձ5PLZP JO0QFO/FUXPSL4QBDF

  27. ࠓ೔ݴ͍͔ͨͬͨࣄ JOPUIFSXPSET 5JUBOJVN΋͘΋͘ձ5PLZP JO0QFO/FUXPSL4QBDF

  28. 5Jͷ+40/ ଎͍ Ϟδϡʔϧͷϝιουݺͼग़͠ ஗͍ ͔΋ 5JUBOJVN΋͘΋͘ձ5PLZP JO0QFO/FUXPSL4QBDF ҆৺ͯ͠࢖͓͏ ϧʔϓதͰ͸஫ҙ

  29. 5JUBOJVN΋͘΋͘ձ5PLZP JO0QFO/FUXPSL4QBDF CODESTRONG! ͓͠·͍