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 ...
The code you posted assumes that the 4th view on the panel is a label. Based on the error message there is exactly one view on the panel. Maybe it is another panel.
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
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.