NSArray of dictionaries

Total Post:214

 1265  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;



  1. Post:39

    Re: NSArray of dictionaries

    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];

      Modified On Apr-10-2018 01:28:35 AM


Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.