iOS Question Unexpected error - Object was not initialized

jai

Active Member
Licensed User
Longtime User
An app that worked normal last week is suddenly throwing error "Object was not initialized (UILabel)". No changes have been made since the last run. The object (label) is entered via designer and declared with-
B4X:
    Private lblSeparationFromMainBanner As Label

Part of the code. Error occurs on the first line of the following code block-
B4X:
    lblSeparationFromMainBanner.Left=0
    lblSeparationFromMainBanner.Width=ScreenWidth
    lblSeparationFromMainBanner.Height=1dip*Vscale
    If IsVertical=False Then lblSeparationFromMainBanner.Height=1dip*Hscale
    lblSeparationFromMainBanner.Top=Buttons(1).top+Buttons(1).height+1dip
    lblSeparationFromMainBanner.BringToFront
    If IsAdsAllowd Then
        lblSeparationFromMainBanner.Visible=True
    Else
        lblSeparationFromMainBanner.Visible=False
    End If
I am using B4i ver 8.80 and an iPhone 14. What could be causing it?

Full error message-
B4X:
SuperCrossPercentPayoutQ(4)=35
iPhone Horizontal=false
Error occurred on line: 3407 (Main)
Object was not initialized (UILabel)
Stack Trace: (
  CoreFoundation       6A60BE13-E657-3BEC-A9AC-BA239AE29862 + 185848
  libobjc.A.dylib      objc_exception_throw + 88
  CoreFoundation       6A60BE13-E657-3BEC-A9AC-BA239AE29862 + 1550048
  GamePool             -[B4IObjectWrapper object] + 116
  GamePool             -[B4IViewWrapper setLeft:] + 44
  GamePool             -[b4i_main _adjustforbannerad] + 4024
  GamePool             -[b4i_main _readdata::] + 54176
  GamePool             -[b4i_main _readinitialdata] + 1164
  GamePool             -[ResumableSub_main_Application_Start resume::] + 36708
  GamePool             -[b4i_main _application_start:] + 388
 CoreFoundation       6A60BE13-E657-3BEC-A9AC-BA239AE29862 + 196132
 CoreFoundation       6A60BE13-E657-3BEC-A9AC-BA239AE29862 + 192108
 GamePool             +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1352
 GamePool             -[B4IShell runMethod:] + 320
 GamePool             -[B4IShell raiseEventImpl:method:args::] + 928
 GamePool             -[B4IShellBI raiseEvent:event:params:] + 1008
 GamePool             __33-[B4I raiseUIEvent:event:params:]_block_invoke + 52
 libdispatch.dylib    8CE3AFB9-6D84-3446-8FD4-E5F798D98403 + 8776
 libdispatch.dylib    8CE3AFB9-6D84-3446-8FD4-E5F798D98403 + 16296
 libdispatch.dylib    8CE3AFB9-6D84-3446-8FD4-E5F798D98403 + 76340
 libdispatch.dylib    _dispatch_main_queue_callback_4CF + 44
 CoreFoundation       6A60BE13-E657-3BEC-A9AC-BA239AE29862 + 498620
 CoreFoundation       6A60BE13-E657-3BEC-A9AC-BA239AE29862 + 483760
 CoreFoundation       CFRunLoopRunSpecific + 588
 GraphicsServices     GSEventRunModal + 164
 UIKitCore            F80C6EE4-50CA-346F-90EB-BB3DA9817503 + 4122492
 UIKitCore            UIApplicationMain + 340
 GamePool             main + 100
 dyld                 4EB7459F-E237-38CE-8240-3F3E2E1CE5AB + 196072
)
Application_Active

Thanks.
 

jai

Active Member
Licensed User
Longtime User
I cannot say why the label isn't initialized, however you can check it:
B4X:
If lblSeparationFromMainBanner.IsInitialized = False Then Return


Hard to diagnose on the face of it. I suspect the problem may have stemmed from elsewhere; corrupt source file or long folder name. I recopied a fresh new folder from backup and renamed it in shorter size (original folder name was over 70 chracters long). It now compiles and runs normal in v8.80.

Thanks for your responses!
 
Upvote 0
Top