list - How to store the data like category in ios -
i'm working 1 shopping app , have response data's categories example main category has men, women,kids etc. each 1 has sub-category t-shirts, shirts, footwear etc , have sub category(ex.footwear) casual shoes,formal shoes,sandals etc.
how can store response , how show 1 particular category?
this response
{ "success":true, "category":[ { "category_id":"74", "parent_id":"0", "name":"grocery", "image":"catalog\/rice.jpg", "top":"1", "column":"1", "sort_order":"0", "status":"1", "date_added":"2015-03-25 11:26:46", "date_modified":"2015-04-20 11:04:29", "description":"<p><br><\/p>", "meta_title":"grocery", "meta_description":"", "meta_keyword":"", "store_id":"0", "subcategory":[ { "category_id":"75", "parent_id":"74", "name":"dals & pulses", "image":"catalog\/0004620_dm-gram-dal-1kg.png", "top":"0", "column":"0", "sort_order":"1", "status":"1", "date_added":"2015-03-25 11:42:20", "date_modified":"2015-04-20 11:08:24", "description":"<p><br><\/p>", "meta_title":"dals & pulses", "meta_description":"", "meta_keyword":"", "store_id":"0" }, { "category_id":"76", "parent_id":"74", "name":"dry fruits & nuts", "image":"catalog\/almonds.jpg", "top":"0", "column":"0", "sort_order":"2", "status":"1", "date_added":"2015-03-25 12:17:39", "date_modified":"2015-04-20 11:08:11", "description":"<p><br><\/p>", "meta_title":"dry fruits & nuts", "meta_description":"", "meta_keyword":"", "store_id":"0" }, { "category_id":"77", "parent_id":"74", "name":"edible oil & ghees", "image":"catalog\/oil.jpg", "top":"0", "column":"0", "sort_order":"3", "status":"1", "date_added":"2015-03-25 15:06:06", "date_modified":"2015-04-16 18:03:13", "description":"<p><br><\/p>", "meta_title":"edible oil & ghees", "meta_description":"", "meta_keyword":"", "store_id":"0" }, { "category_id":"78", "parent_id":"74", "name":"atta & flour", "image":"catalog\/aashirvaad-atta-whole-wheat-noworry.jpg", "top":"0", "column":"0", "sort_order":"5", "status":"1", "date_added":"2015-03-25 16:27:52", "date_modified":"2015-04-20 11:04:38", "description":"<p><br><\/p>", "meta_title":"atta & flour", "meta_description":"", "meta_keyword":"", "store_id":"0" }, { "category_id":"79", "parent_id":"74", "name":"rice", "image":"catalog\/rice.jpg", "top":"0", "column":"0", "sort_order":"6", "status":"1", "date_added":"2015-03-25 16:42:55", "date_modified":"2015-04-16 18:03:40", "description":"<p><br><\/p>", "meta_title":"rice", "meta_description":"", "meta_keyword":"", "store_id":"0" }, { "category_id":"80", "parent_id":"74", "name":"salt & sugar", "image":"catalog\/sugar.jpg", "top":"0", "column":"0", "sort_order":"7", "status":"1", "date_added":"2015-03-25 16:53:12", "date_modified":"2015-03-25 20:10:24", "description":"<p><br><\/p>", "meta_title":"salt & sugar", "meta_description":"", "meta_keyword":"", "store_id":"0" }, { "category_id":"81", "parent_id":"74", "name":"millets", "image":"catalog\/millets.jpg", "top":"0", "column":"0", "sort_order":"8", "status":"1", "date_added":"2015-03-25 17:02:57", "date_modified":"2015-04-16 18:04:09", "description":"<p><br><\/p>", "meta_title":"millets", "meta_description":"", "meta_keyword":"", "store_id":"0" } ] }, { "category_id":"82", "parent_id":"0", "name":"chips", "image":null, "top":"1", "column":"1", "sort_order":"2", "status":"1", "date_added":"2015-03-27 18:31:51", "date_modified":"2015-04-24 00:01:47", "description":"<p>chips crispy<\/p>", "meta_title":"chips", "meta_description":"", "meta_keyword":"", "store_id":"0", "subcategory":[ { "category_id":"83", "parent_id":"82", "name":"lays", "image":"catalog\/cashew4.jpg", "top":"0", "column":"0", "sort_order":"1", "status":"1", "date_added":"2015-03-27 18:32:53", "date_modified":"2015-04-23 23:45:59", "description":"<p>lays<\/p>", "meta_title":"lays", "meta_description":"", "meta_keyword":"", "store_id":"0" } ] }, { "category_id":"84", "parent_id":"0", "name":"food items", "image":"catalog\/slide.jpg", "top":"1", "column":"1", "sort_order":"3", "status":"1", "date_added":"2015-04-26 22:13:21", "date_modified":"2015-04-26 22:13:21", "description":"food items", "meta_title":"food items", "meta_description":"", "meta_keyword":"", "store_id":"0", "subcategory":"null" }, { "category_id":"86", "parent_id":"0", "name":"household", "image":"catalog\/aashirvaad-atta-whole-wheat-noworry.jpg", "top":"1", "column":"1", "sort_order":"5", "status":"1", "date_added":"2015-04-26 22:36:03", "date_modified":"2015-04-26 22:40:46", "description":"household", "meta_title":"household", "meta_description":"", "meta_keyword":"", "store_id":"0", "subcategory":"null" }, { "category_id":"85", "parent_id":"0", "name":"bread & diary", "image":"catalog\/orid dhal 500gm.jpg", "top":"1", "column":"1", "sort_order":"6", "status":"1", "date_added":"2015-04-26 22:30:14", "date_modified":"2015-04-26 22:40:17", "description":"bread &amp; diary", "meta_title":"bread & diary", "meta_description":"", "meta_keyword":"", "store_id":"0", "subcategory":"null" }, { "category_id":"87", "parent_id":"0", "name":"fruits & vegetables", "image":"catalog\/cashew4.jpg", "top":"1", "column":"1", "sort_order":"7", "status":"1", "date_added":"2015-04-26 22:41:52", "date_modified":"2015-04-26 22:41:52", "description":"fruits &amp; vegetables", "meta_title":"fruits & vegetables", "meta_description":"", "meta_keyword":"", "store_id":"0", "subcategory":"null" } ] }
you can create class "clothes" in class have properties "category","subcategory","title","image". "category" can use typedef enum. if want save objects use coredata, create entity similar properties , save data.
Comments
Post a Comment