UNICORN - iOS
実体メソッド | プロパティ | 全メンバ一覧
SBJsonParser クラス

Parse JSON Strings and NSData objects. [詳解]

#import <SBJsonParser.h>

SBJsonParser の継承関係図

実体メソッド

(id) - objectWithData:
 Return the object represented by the given NSData object. [詳解]
 
(id) - objectWithString:
 Return the object represented by the given string. [詳解]
 
(id) - objectWithString:error:
 Return the object represented by the given string. [詳解]
 

プロパティ

NSUInteger maxDepth
 The maximum recursing depth. [詳解]
 
NSString * error
 Description of parse error. [詳解]
 

詳解

Parse JSON Strings and NSData objects.

This uses SBJsonStreamParser internally.

参照
Objective-C to JSON

メソッド詳解

- (id) objectWithData: (NSData*)  data

Return the object represented by the given NSData object.

The data must be UTF8 encoded.

引数
dataAn NSData containing UTF8 encoded data to parse.
戻り値
The NSArray or NSDictionary represented by the object, or nil if an error occured.
- (id) objectWithString: (NSString *)  repr

Return the object represented by the given string.

This method converts its input to an NSData object containing UTF8 and calls -objectWithData: with it.

戻り値
The NSArray or NSDictionary represented by the object, or nil if an error occured.
- (id) objectWithString: (NSString*)  jsonText
error: (NSError**)  error 

Return the object represented by the given string.

This method calls objectWithString: internally. If an error occurs, and if error is not nil, it creates an NSError object and returns this through its second argument.

引数
jsonTextthe json string to parse
errorpointer to an NSError object to populate on error
戻り値
The NSArray or NSDictionary represented by the object, or nil if an error occured.

プロパティ詳解

- (NSString*) error
readwriteatomiccopy

Description of parse error.

This method returns the trace of the last method that failed. You need to check the return value of the call you're making to figure out if the call actually failed, before you know call this method.

戻り値
A string describing the error encountered, or nil if no error occured.
- (NSUInteger) maxDepth
readwriteatomic

The maximum recursing depth.

Defaults to 32. If the input is nested deeper than this the input will be deemed to be malicious and the parser returns nil, signalling an error. ("Nested too deep".) You can turn off this security feature by setting the maxDepth value to 0.


このクラス詳解は次のファイルから抽出されました: