我用NSDictionary
和NSArray
爲我的頭粉碎了我的腦袋。對象中的NSMutableDictionary和NSMutableArray對象
我得到2個可變數組,我想合併它們。
的NSMutableArray 1:
{
email = "[email protected]";
"password" = "2017-05-23 13:08:03";
}
的NSMutableArray 2
(
{
"created_at" = "2017-06-22 00:00:00";
"id_weather_city" = 1;
name = Cityname;
"updated_at" = "2017-06-22 00:00:00";
},
{
"created_at" = "2017-06-22 00:00:00";
"id_weather_city" = 2;
name = Cityname2;
"updated_at" = "2017-06-22 00:00:00";
}
)
我想他們這樣的結合在一起,但我不知道如何正確 數組:
{
email = "[email protected]";
"password" = "2017-05-23 13:08:03";
"weather":(
{
"created_at" = "2017-06-22 00:00:00";
"id_weather_city" = 1;
name = Cityname;
"updated_at" = "2017-06-22 00:00:00";
},
{
"created_at" = "2017-06-22 00:00:00";
"id_weather_city" = 2;
name = Cityname2;
"updated_at" = "2017-06-22 00:00:00";
}
)
}
能分享你做了什麼? –