public class NSJSONSerialization extends NSObject
Constructor and Description |
---|
NSJSONSerialization() |
Modifier and Type | Method and Description |
---|---|
static NSData |
dataWithJSONObject(Object source,
int NSJSONWritingOptions,
crossmobile.rt.StrongReference<NSError> error)
Returns the JSON data that results from specified Foundation object.
|
static boolean |
isValidJSONObject(Object source)
Returns a Boolean that shows whether the specified object is feasible to
be converted to JSON data.
|
static Object |
JSONObjectWithData(NSData data,
int NSJSONReadingOptions,
crossmobile.rt.StrongReference<NSError> error)
Returns a Foundation object originated from the specified JSON data.
|
addObserver, observeValueForKeyPath, performSelector, performSelectorOnMainThread, release, removeObserver, removeObserver, retain, setValueForKey, setValueForUndefinedKey, valueForKey, valueForUndefinedKey
public static Object JSONObjectWithData(NSData data, int NSJSONReadingOptions, crossmobile.rt.StrongReference<NSError> error)
data
- A NSData object that contains the JSON data.NSJSONReadingOptions
- The options for reading the JSON data.error
- The error that occurs in case of failure.NSJSONReadingOptions
public static NSData dataWithJSONObject(Object source, int NSJSONWritingOptions, crossmobile.rt.StrongReference<NSError> error)
source
- The object to be converted Should be either
Map<String,Object> or List<Object>.NSJSONWritingOptions
- The NSJSONWritingOptions option.error
- The error that describes the situation in case of failure.NSJSONWritingOptions
public static boolean isValidJSONObject(Object source)
source
- The object that is checked if the conversion to JSON data
is feasible.Copyright © 2020. All rights reserved.