I have an application that uses a standard iOSTable connected to a DataSource that implements the recommended methods.
The RowData() methods returns an iOSCustomTableCell for each row that has two iOSLabels and, depending on the data, either an iOSSwitch, or a subclass of an iOSLibTextField (and I have for testing added an iOSTextField).
Changing the switch, completing editing of the iOSLibTextField (and in testing the TextChange event of the IOSTextField) all call the same method, which updates the table source data and then calls iOSTable. ReloadData.
I find that if I change the switch or the iOSTextField, then iOSTable.ReloadData triggers my RowData() methods and the table reloads as expected.
However, if I change the iOSLibTextField, I can step through and see the same code execute through the iOSTable.ReloadData, but this then is not followed by the iOSTable calling the RowData() method.
No. I am using the the ReloadData (the whole table) method.
The table is a list of input parameters and the resulting outputs (conceptually a multi variable calculator - Enter any 3 of 4 parameters and the fourth will be calculated) .
I had originally designed it with a ‘Calculate’ button so that I wouldn’t generate garbage calculations on each keystroke (due to iOSTextField not having a LostFocus or DoneEditing event).
I replaced the relevant iOSTextField with and iOSLibTextField which does have a rich support of events such as ShouldEndEditing to allow validation. However, this seems to result in some interaction where the table doesn’t reload its data on a .ReloadData call, but will if I have toggled a switch or entered data into an ordinary text field.
Thank you for the tip. I seem to have implemented it wrong. When I click into the my subclass of IOSTextField (subclassed to support some application specific unit of measure conversions and validations), the simulated application crashes out on a black screen (the simulator itself doesn’t crash).
I have set breakpoints and find that the text change event correctly cals start timer code and this sets up the reference to CheckFirstResponder, calls it and then gets to just prior to the if isFirstResponder… statement, and then crashes on the next step.
I assume that I have made an error either in the declare or in the passing of the pointer. Quantity is the name of my subclassed iOSTextField and the code I am using is below.
[code]declare Function isFirstResponder lib “Foundation.Framework” selector “isFirstResonder” (obj_id as Ptr) as Boolean
if isFirstResponder (Quantity.Handle) then
IsFocused = true
else
IsFocused=false
end if[/code]