iOS Question About Tableview

moore_it

Well-Known Member
Licensed User
Longtime User
Hi all,

how i do to read the custom cell data in tableView ?
I'm using this code from Erel :

[code/]
For Each tc As TableCell In myTableView.GetItems(0)
Dim parent As Panel = tc.CustomView
Dim l As Label = parent.GetView(3)
Dim tf As TextField = parent.GetView(5)
next
[/code]

but i have always this error ...

*** -[__NSArrayM objectAtIndex:]: index 3 beyond bounds [0 .. 0]

the panel is load in tablecell with loadlayout ...

Thanks for help !
Toni
 

moore_it

Well-Known Member
Licensed User
Longtime User
yes my panel in designer have a lebel in 4th position, but the panel have no views why ?

my code is :

B4X:
sub addcell
    Dim p As Panel
     p.Initialize("")
     p.Width = 100%x
     p.Height = myTableView.RowHeight
     p.LoadLayout("pOrderRowAddCell")

    Dim tc As TableCell = myTableView.AddSingleLine("")
     tc.ShowSelection = False
     tc.AccessoryType = tc.ACCESSORY_NONE
     tc.CustomView = p
end sub
 
Upvote 0

moore_it

Well-Known Member
Licensed User
Longtime User
I found my error, in designer i've create a panel and into it i create other objects.
The objects (label textfield and so on) will be created externally of the panel.
 
Upvote 0
Top