1
我有一個NSDictionary的陣營本地JSONSerialization
address = {
address1 = "Ivy House";
address2 = "Sandy Lane";
city = Rush;
country = Ireland;
county = Dublin;
email = "[email protected]";
mobile = "<null>";
postCode = "<null>";
smsAlert = "<null>";
telephone = 18437584;
websiteAddress = "www.example.com";
};
,我需要通過這個反應母語作爲接受JSON一個launchOptions是這種格式。 (報價及=替換爲:等)
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"spotlight"
initialProperties:nil
launchOptions:launchOptions];
JSON
"address":
{
"address1": "Ivy House",
"address2": "Sandy Lane",
"city": "Rush",
"postCode": null,
"email": "[email protected]",
"telephone": "18437584",
"mobile": null,
"smsAlert": null,
"county": "Dublin",
"country": "Ireland",
"websiteAddress": "www.example.com"
},
什麼是改變我的字典,使反應本土接受它的最佳方式?
你是否看了[JSONSerialization(https://developer.apple.com/reference/foundation/jsonserialization)文檔? –