タグ

iosとJSONに関するNyohoのブックマーク (2)

  • RPJSONMapperでお手軽マッピング - Qiita

    JSONから生成したNSDictionaryをオブジェクトにマッピングするのって面倒ですよね。 こんなん。 NSDictionary *jsonDictionary = @{ @"id": @123, @"username": @"taro yamada" }; User *user = [[User alloc] init]; user.id = jsonDictionary[@"id"]; user.name = jsonDictionary[@"username"]; この手のマッピング用ライブラリはたくさんあるんですが、探した中ではRPJSONMapperが使いやすそうでした。 マッピング定義が辞書で簡単に書ける マッピング定義を一箇所に書ける トランスフォーム(型変換)が出来る 例えばJSONリストをマッピングしてみる。 @implementation Note @propert

    RPJSONMapperでお手軽マッピング - Qiita
    Nyoho
    Nyoho 2014/05/24
    便利そう。コメントも見る。
  • SBJson for Objective-C

    Update <2018-01-26 Fri> Not going to lie: this site is woefully out of date, and unless someone steps in to update it it’s going to stay that way. Your best bet is heading to github.com/stig/json-framework rather than relying on this site. PS: I’m no longer going to pay for the sbjson.org domain, so I’ve done a minimal change to host this site from stig.github.io/json-framework instead. Update End

    Nyoho
    Nyoho 2012/08/31
  • 1