ujell / YUTableView

Subclass of UITableView which adds expandable sub-menu support to it.
MIT License
35 stars 12 forks source link

how to add tableView:numberOfRowsInSection in YUTableView #2

Closed avinashvaghasiya closed 8 years ago

ujell commented 8 years ago

Nor sure what you mean with this.

YUTableView implements tableView:numberOfRowsInSection and it uses YUTableViewItem objects to display rows. If you need more rows you should create new items and add them to tableViewItems array, if you need more sections, unfortunately that’s not possible right now.

Also if you’d like the learn number of displayed rows you can call [yourTableView numberOfRowsInSection:0];

avinashvaghasiya commented 8 years ago

but how can define this metho like.- (void)didSelectedRow:(YUTableViewItem *)item

tableView:numberOfRowsInSection this method how can define an item count return

avinashvaghasiya commented 8 years ago

How to add this type data in YUTableView in ios. Like this…. how to add and implement this type data in item1, item2,item3 etc 1.Kurtis 1.Cotton kurtis 1.Wollen kurtis 2.Suits

plz help me

( { "cat_id" = 3; "cat_name" = Kurtis; "sub_cat_data" = ( { "sub_cat_id" = 13; "sub_cat_name" = "Cotton Kurtis"; "sub_data" = ( { "sub_id" = 16; "sub_name" = "Woolen Kurtis"; }, { "sub_id" = 15; "sub_name" = "Rayon Kurtis"; } ); }, { "sub_cat_id" = 14; "sub_cat_name" = "Georgette Kurtis"; }, { "sub_cat_id" = 17; "sub_cat_name" = "Show All Kurtis"; } ); }, { "cat_id" = 18; "cat_name" = Suits; }, { "cat_id" = 19; "cat_name" = Dresses; }, { "cat_id" = 20; "cat_name" = Tops; }, { "cat_id" = 21; "cat_name" = Bottoms; "sub_cat_data" = ( { "sub_cat_id" = 22; "sub_cat_name" = "Churidar Pants"; }, { "sub_cat_id" = 23; "sub_cat_name" = "Harem Pants"; }, { "sub_cat_id" = 24; "sub_cat_name" = "Jeans and Pants"; }, { "sub_cat_id" = 25; "sub_cat_name" = Jeggings; }, { "sub_cat_id" = 26; "sub_cat_name" = "Patiyala Salwar Only"; }, { "sub_cat_id" = 27; "sub_cat_name" = "Patiyalas With Dupatta"; }, { "sub_cat_id" = 28; "sub_cat_name" = Palazzos; }, { "sub_cat_id" = 29; "sub_cat_name" = Skirts; }, { "sub_cat_id" = 30; "sub_cat_name" = Leggings; }, { "sub_cat_id" = 31; "sub_cat_name" = "Show All Bottoms"; } ); }, { "cat_id" = 32; "cat_name" = "Suits Catalogue"; }, { "cat_id" = 33; "cat_name" = Dupattas; }, { "cat_id" = 39; "cat_name" = "Jaipuri Bandhani"; }, { "cat_id" = 40; "cat_name" = Sarees; } )

ujell commented 8 years ago

For creating data, please check createCellItems method which is inside ComplexViewController class in the demo project, it’s pretty similar. You need to convert your JSON to NSDictionary then loop over it and create YUTableViewItems. Since the problem with the tableView:numberOfRowsInSection is still not clearly explained i’m closing the issue.