iOS Question [Solved]iTableView2 Problem ?

RichardN

Well-Known Member
Licensed User
Longtime User
Using the iTableView2 library I am trying to catch a selection in the SelectedChanged event where the DetailText contains an asterisk. Like this....
B4X:
Sub AirportList_SelectedChanged (SectionIndex As Int, Cell As TableCell)

    Private AirportIATA As String = Cell.DetailText.ToString
    
    If AirportIATA.Contains("*") Then Return    'Exit & do nothing
    
    Results.Show(AirportIATA)                   'Do more stuff   
    
End Sub

The error that follows is this:
Application_Start
Application_Active
Error occurred on line: 209 (PopulateList)
Object was not initialized (NSAttributedString)
Stack Trace: (
CoreFoundation <redacted> + 252
libobjc.A.dylib objc_exception_throw + 56
CoreFoundation <redacted> + 0
World Airports -[B4IObjectWrapper object] + 152
World Airports -[B4IAttributedString ToString] + 36
CoreFoundation <redacted> + 144
CoreFoundation <redacted> + 284
World Airports +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1624
World Airports -[B4IShell runMethod:] + 448
World Airports -[B4IShell raiseEventImpl:method:args::] + 1640
World Airports -[B4IShellBI raiseEvent:event:params:] + 1560
World Airports +[B4IObjectWrapper raiseEvent:::] + 300
World Airports -[B4ITableViewDelgate tableView:didSelectRowAtIndexPath:] + 360
UIKit <redacted> + 1356
UIKit <redacted> + 268
UIKit <redacted> + 296
UIKit <redacted> + 384
UIKit <redacted> + 132
CoreFoundation <redacted> + 32
CoreFoundation <redacted> + 412
CoreFoundation <redacted> + 1436
CoreFoundation CFRunLoopRunSpecific + 552
GraphicsServices GSEventRunModal + 100
UIKit UIApplicationMain + 236
World Airports main + 124
libdyld.dylib <redacted> + 4
)
By trial & error I can isolate the exception to the 'AirportIATA.Contains("*")' line. However, the IDE never highlights that line as the line where the exception has occurred, instead other lines, often ones with no code on them are highlighted. What is going on?
 

RichardN

Well-Known Member
Licensed User
Longtime User
I already tried that. I get an almost identical error log.

The IDE reports error on line 225 which for some reason is the End Sub of the Page_Resize event

Application_Start
Application_Active
Error occurred on line: 225 (PopulateList)
Object was not initialized (NSAttributedString)
Stack Trace: (
CoreFoundation <redacted> + 252
libobjc.A.dylib objc_exception_throw + 56
CoreFoundation <redacted> + 0
World Airports -[B4IObjectWrapper object] + 152
World Airports -[B4IAttributedString ToString] + 36
CoreFoundation <redacted> + 144
CoreFoundation <redacted> + 284
World Airports +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1624
World Airports -[B4IShell runMethod:] + 448
World Airports -[B4IShell raiseEventImpl:method:args::] + 1640
World Airports -[B4IShellBI raiseEvent:event:params:] + 1560
World Airports +[B4IObjectWrapper raiseEvent:::] + 300
World Airports -[B4ITableViewDelgate tableView:didSelectRowAtIndexPath:] + 372
UIKit <redacted> + 1356
UIKit <redacted> + 268
UIKit <redacted> + 296
UIKit <redacted> + 384
UIKit <redacted> + 132
CoreFoundation <redacted> + 32
CoreFoundation <redacted> + 412
CoreFoundation <redacted> + 1436
CoreFoundation CFRunLoopRunSpecific + 552
GraphicsServices GSEventRunModal + 100
UIKit UIApplicationMain + 236
World Airports main + 124
libdyld.dylib <redacted> + 4
)
 
Upvote 0

RichardN

Well-Known Member
Licensed User
Longtime User
I went back & reviewed the documentation again. I had added the iTableView programmatically rather than adding as a custom view from the designer.

To add to my confusion this incorrect method appears to work perfectly well (both for iTableView2 and iUI8) in almost all regards until you come to applying certain string functions to the table cell contents!
 
Upvote 0
Top