Home > DeveloperSection > Forums > NSArray of dictionaries
Tarun Kumar

Total Post:210

Posted on    July-17-2015 11:49 PM

 iPhone iPhone  Ios  Objective C 

 1 Reply(s)
 588  View(s)
Rate this:

I have NSArray of NSDictionaries which is coming from server as JSON format. I want to add one more NSDictinoary to the NSArray of NSDictionaries. NSDictionary is based on key value pair. This is the response which I am getting. I want to add another dictionary of same format into "table". Pls Help..

Thanks in advance..!!

Table =  (


            Name = “xyz”;

            Recordid = 3;

            prefrenceorder = 1;



            Name = “ABC”;

            Recordid = 2;

            prefrenceorder = 2;



            Name = “swe”;

            Recordid = 450;

            prefrenceorder = 3;



            Name = “asd”;

            Recordid = 451;

            prefrenceorder = 4;



Andrew Watson
Andrew Watson

Total Post:39

Posted on    July-18-2015 6:56 AM

As the NSArray coming from server is immutable so you need to create a new instance of NSMutableArray to add your own dictionary with the response coming from server.

NSMutableArray *newTable = [NSMutableArray arrayWithArray:Table];

[newTable addObject:your_new_dictionary];

Don't want to miss updates? Please click the below button!

Follow MindStick