UNICORN - iOS
実体メソッド | 全メンバ一覧
NSObject(SBProxyForJson) カテゴリ

Enable JSON writing for non-native objects. [詳解]

#import <SBJsonStreamWriter.h>

実体メソッド

(id) - proxyForJson
 Allows generation of JSON for otherwise unsupported classes. [詳解]
 

詳解

Enable JSON writing for non-native objects.

メソッド詳解

- (id) proxyForJson

Allows generation of JSON for otherwise unsupported classes.

If you have a custom class that you want to create a JSON representation for you can implement this method in your class. It should return a representation of your object defined in terms of objects that can be translated into JSON. For example, a Person object might implement it like this:

- (id)proxyForJson {
return [NSDictionary dictionaryWithObjectsAndKeys:
name, @"name",
phone, @"phone",
email, @"email",
nil];
}

このカテゴリ詳解は次のファイルから抽出されました: