iOS Question Error occurred on line: 59

simonwilliamson

Member
Licensed User
I seem to have an error raising event in my B4XPages iOS app that always appears on line 59 regardless of which module has raised it. Does anybody know what might be causing it?
Sometimes there is code or a declaration on line 59 of the named module but sometimes line 59 has no code on it at all.
The Android version does not have the same issue.

Error occurred on line: 59 (B4XMainPage)
Target is null. Method called: _initialize:::
Stack Trace: (
CoreFoundation 96F8386D-D88A-3C89-A323-A17975C3317F + 1157608
libobjc.A.dylib objc_exception_throw + 56
CoreFoundation 96F8386D-D88A-3C89-A323-A17975C3317F + 120000
ATTMA Air Testing +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 172
ATTMA Air Testing -[B4ICustomViewWrapper AfterDesignerScript] + 2076
ATTMA Air Testing -[B4ILayoutBuilder loadLayout:::] + 2696
ATTMA Air Testing -[B4IPanelWrapper LoadLayout::] + 204
ATTMA Air Testing -[B4XViewWrapper LoadLayout::] + 100
ATTMA Air Testing -[b4i_preparationview _designercreateview::::] + 1096
ATTMA Air Testing -[ResumableSub_b4xmainpage_load_middle_page resume::] + 20260
ATTMA Air Testing -[b4i_b4xmainpage _load_middle_page::] + 548
ATTMA Air Testing -[b4i_b4xmainpage _navtoppanelclick::] + 3452
ATTMA Air Testing -[b4i_b4xmainpage _navtoppanel_touch::::] + 676
CoreFoundation 96F8386D-D88A-3C89-A323-A17975C3317F + 1175856
CoreFoundation 96F8386D-D88A-3C89-A323-A17975C3317F + 8640
ATTMA Air Testing +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1608
ATTMA Air Testing -[B4IShell runMethod:] + 448
ATTMA Air Testing -[B4IShell raiseEventImpl:method:args::] + 2172
ATTMA Air Testing -[B4IShellBI raiseEvent:eventarams:] + 1580
ATTMA Air Testing -[B4IPanelView touchesBegan:withEvent:] + 712
UIKitCore 71B59F62-19DA-3CFF-89E1-DACF333BAB0D + 11984176
UIKitCore 71B59F62-19DA-3CFF-89E1-DACF333BAB0D + 11991220
UIKitCore 71B59F62-19DA-3CFF-89E1-DACF333BAB0D + 11841104
UIKitCore 71B59F62-19DA-3CFF-89E1-DACF333BAB0D + 12375132
UIKitCore 71B59F62-19DA-3CFF-89E1-DACF333BAB0D + 12393468
UIKitCore 71B59F62-19DA-3CFF-89E1-DACF333BAB0D + 12357344
CoreFoundation 96F8386D-D88A-3C89-A323-A17975C3317F + 633824
CoreFoundation 96F8386D-D88A-3C89-A323-A17975C3317F + 633568
CoreFoundation 96F8386D-D88A-3C89-A323-A17975C3317F + 630312
CoreFoundation 96F8386D-D88A-3C89-A323-A17975C3317F + 607184
CoreFoundation CFRunLoopRunSpecific + 572
GraphicsServices GSEventRunModal + 160
UIKitCore 71B59F62-19DA-3CFF-89E1-DACF333BAB0D + 11716152
UIKitCore UIApplicationMain + 164
ATTMA Air Testing main + 128
libdyld.dylib E31C0887-C999-3047-9B80-203248EC2396 + 5512
)
 

simonwilliamson

Member
Licensed User
It seems the line number shown is always the line number of the 'End Sub' of the DesignerCreateView sub for a custom control that in turn has a custom control in it as well.

Hence why the line 59 was appearing on every module that had this custom control on it.

Is this setup not allowed with B4XPages and iOS?

 
Upvote 0

simonwilliamson

Member
Licensed User
Thank you for your prompt response, as always.

If I put the sleep in the error still happens but the line number indicated becomes the line the sleep was called on.

If I remove the sleep on line 46 the error moves to line 49.

I also put a sleep on the custom control module that is called from the initial custom control.



The second (nested) custom control does contain a CustomListView if that is relevant?

Any suggestions welcomed?
 
Upvote 0

simonwilliamson

Member
Licensed User
Apologies.

Code:
Public Sub DesignerCreateView (Base As Object, Lbl As Label, Props As Map)

mBase = Base

imageTypeID = Props.GetDefault("imageTypeID",0)
Sleep(0)

mBase.LoadLayout("imagePreviewList")
Sleep(0)

#if b4a
CC.Initialize("IC")
#end if


End Sub

Error:
Application_Start
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
Application_Active
Class (b4i_homeview) instance released.
Error occurred on line: 46 (imagePreviewList)
Target is null. Method called: _initialize:::
Stack Trace: (
CoreFoundation 96F8386D-D88A-3C89-A323-A17975C3317F + 1157608
libobjc.A.dylib objc_exception_throw + 56
CoreFoundation 96F8386D-D88A-3C89-A323-A17975C3317F + 120000
ATTMA Air Testing +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 172
ATTMA Air Testing -[B4ICustomViewWrapper AfterDesignerScript] + 2076
ATTMA Air Testing -[B4ILayoutBuilder loadLayout:::] + 2696
ATTMA Air Testing -[B4IPanelWrapper LoadLayout::] + 204
ATTMA Air Testing -[B4XViewWrapper LoadLayout::] + 100
ATTMA Air Testing -[b4i_preparationview _designercreateview::::] + 1096
ATTMA Air Testing -[ResumableSub_b4xmainpage_load_middle_page resume::] + 20260
ATTMA Air Testing -[b4i_b4xmainpage _load_middle_page::] + 548
ATTMA Air Testing -[b4i_setupview _setupforwardbt_click:] + 424
CoreFoundation 96F8386D-D88A-3C89-A323-A17975C3317F + 1175856
CoreFoundation 96F8386D-D88A-3C89-A323-A17975C3317F + 8640
ATTMA Air Testing +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1608
ATTMA Air Testing -[B4IShell runMethod:] + 448
ATTMA Air Testing -[B4IShell raiseEventImpl:method:args::] + 2172
ATTMA Air Testing -[B4IShellBI raiseEvent:eventarams:] + 1580
ATTMA Air Testing __33-[B4I raiseUIEvent:eventarams:]_block_invoke + 60
libdispatch.dylib 6C143C51-288F-3CD0-84DD-17B9A0AAEE62 + 393880
libdispatch.dylib 6C143C51-288F-3CD0-84DD-17B9A0AAEE62 + 397952
libdispatch.dylib 6C143C51-288F-3CD0-84DD-17B9A0AAEE62 + 65628
CoreFoundation 96F8386D-D88A-3C89-A323-A17975C3317F + 632272
CoreFoundation 96F8386D-D88A-3C89-A323-A17975C3317F + 608888
CoreFoundation CFRunLoopRunSpecific + 572
GraphicsServices GSEventRunModal + 160
UIKitCore 71B59F62-19DA-3CFF-89E1-DACF333BAB0D + 11716152
UIKitCore UIApplicationMain + 164
ATTMA Air Testing main + 128
libdyld.dylib E31C0887-C999-3047-9B80-203248EC2396 + 5512
)
 
Upvote 0

simonwilliamson

Member
Licensed User
I think the error messages above were miss-leading me as after rebuilding the entire page control by control I discovered one control that related to a custom control that had had it's name changed in a previous version so I guess it couldn't find the associated module. The page now loads correctly.?

Thank you for your time and efforts.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…