I am trying to add a CustomListView to a B4i project.
I am getting this error as soon as Page1_Resize() completes:
The offending line is this:
called withing a function named CreateLabel()
It looks like DesignerLabel is uninitialized when that line is executed.
However, DesignerLabel is defined in a function named DesignerCreateView() which apparently is never called:
I have attached the project using this code.
Thanks in advance for any help...
I am getting this error as soon as Page1_Resize() completes:
B4X:
Application_Start
Error occurred on line: 150 (CustomListView)
Object was not initialized (UILabel)
Stack Trace: (
CoreFoundation <redacted> + 252
libobjc.A.dylib objc_exception_throw + 56
CoreFoundation <redacted> + 0
LightController -[B4IObjectWrapper object] + 152
LightController -[B4ILabelWrapper TextAlignment] + 40
CoreFoundation <redacted> + 144
CoreFoundation <redacted> + 284
LightController +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1624
LightController -[B4IShell runMethod:] + 448
LightController -[B4IShell raiseEventImpl:method:args::] + 1640
LightController -[B4IShellBI raiseEvent:event:params:] + 1560
LightController +[B4IDebug delegate:::] + 80
LightController -[b4i_customlistview _createlabel::] + 432
LightController -[b4i_customlistview _insertattextitem::::] + 1304
LightController -[b4i_customlistview _addtextitem:::] + 744
LightController -[b4i_main _pagemain_resize::] + 5744
CoreFoundation <redacted> + 144
CoreFoundation <redacted> + 284
LightController +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1624
LightController -[B4IShell runMethod:] + 448
LightController -[B4IShell raiseEventImpl:method:args::] + 2164
LightController -[B4IShellBI raiseEvent:event:params:] + 1560
LightController +[B4IObjectWrapper raiseEvent:::] + 300
LightController __30-[B4IPanelView layoutSubviews]_block_invoke + 900
libdispatch.dylib <redacted> + 24
libdispatch.dylib <redacted> + 16
libdispatch.dylib <redacted> + 1012
CoreFoundation <redacted> + 12
CoreFoundation <redacted> + 2272
CoreFoundation CFRunLoopRunSpecific + 552
GraphicsServices GSEventRunModal + 100
UIKit UIApplicationMain + 236
LightController main + 124
libdyld.dylib <redacted> + 4
)
The offending line is this:
B4X:
Private Sub CreateLabel(txt As String) As B4XView
[...]
lbl.TextAlignment = DesignerLabel.TextAlignment
[...]
End Sub
It looks like DesignerLabel is uninitialized when that line is executed.
However, DesignerLabel is defined in a function named DesignerCreateView() which apparently is never called:
B4X:
Public Sub DesignerCreateView (Base As Object, Lbl As DesignerLabel = Lbl
[...]
DesignerLabel = Lbl
[...]
End Sub
I have attached the project using this code.
Thanks in advance for any help...