Axel
Axel

Reputation: 83

UITableview inside cell, second UItableview only 1 row, should be more than 1 row

enter image description here

So I'm trying making a multi-level UITableView by using UITableView inside UITableViewCell. Let me explain first:

  1. Red color is Main UITableView
  2. Blue color is Section, so I use as SectionHeader, and add UIButton into it, so can be expanded, and
  3. Green Color, is the cellForRow that include UITableView inside cell.
  4. The flow is, I get all Blue color items which is each Blue Color have children Green
  5. In this logic, if I want to show all blue color as section, so in numberOfSection I return [blueData count];
  6. And numberOfRowsInSection, of course I get from GreenModel *greenData = [blueData.greenData count];
  7. In cellForRow, I'm using UITableView inside cell, so I define blueDatarArray and pass it into cell with properties, like this: cell.greenDataArray = [blueDataArray.greenData mutableCopy];
  8. In UITableViewCell I have UITableView, which is there will be UITableView Delegate and UITableView DataSource
  9. Continue from number 8, I also use a header as return greenData array, which is, from blue having a child is green, and I set in number of section in UITableViewCell's delegate and data source is, numberOfSections in green tableview is refer from number 7 as [greenDataArray count]; so it will be used for header, and also I give button too into it, used to expand and collapse later.
  10. Also in cellForRow, it return [greenData.child count]
  11. And finally in cellForRow is only show up greenData's child but does not appear, take a look at the picture the green having 4 children, but when. I trigger the button, it wont show up... why? I use same logic as red and blue.

How to show greenData's child?

Upvotes: 1

Views: 25

Answers (0)

Related Questions