我想创建一个类似这样的NSDictionary:
"zones": { { "zoneId": "1", "locations": { { "locId": "1", "locZoneId": "1", "locLatitude": "33.68506785633641", "locLongitude": "72.97488212585449" }, { "locId": “2”, "locZoneId": "1", "locLatitude": "33.68506785633641", "locLongitude": "72.97488212585449" }, { "locId": “3”, "locZoneId": "1", "locLatitude": "33.68506785633641", "locLongitude": "72.97488212585449" }, } } }
但我不知道如何创造.
您应该使用数组和字典的组合.
字典初始化如下:
NSDictionary *dict = @{ key : value, key2 : value2};
数组初始化如下:
NSArray *array = @[Object1, Object2]