iOS Question CrashDoctor Diagnosis: Application threw exception NSRangeException

Filippo

Expert
Licensed User
Longtime User
Hi,

i already have 2 users that sent the same crash report and i don't know where this can come from.
Has anyone seen something like this? If so, do you know where this can come from?

Application Specific Information:
*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 2 beyond bounds [0 .. 1]'
 

Attachments

  • crash-report-1.txt
    114.1 KB · Views: 186

Filippo

Expert
Licensed User
Longtime User
The error happens after a call to Sleep, you are getting the item with index 2 from a List with 2 items.
Thanks Erel!
Unfortunately it is not so easy to find the source and the crash report is unfortunately not so helpful.
 
Upvote 0

Filippo

Expert
Licensed User
Longtime User
The error happens after a call to Sleep, you are getting the item with index 2 from a List with 2 items.
I have found the error.
The error happens from iOS-16 .
This code worked without problems until iOS -15.
B4X:
Private Sub FillCronoTimer(Timerlist As List, ListCronoTimerChanged As Boolean)
    Dim racetime1 As RaceProperty
    Dim pnl As Panel

    ClvIndex = ClvIndex + 1 'global int variable
    Dim MyIndex As Int = ClvIndex

    ShowProgressBar(True, 0)
   
    For i = 0 To Timerlist.Size -1
        Log("i=" & i & "/" & Timerlist.Size)
        racetime1 = Timerlist.get(i)          

        ...
        ...

        AddCronoTimer(Racetime,False)

        If Timerlist.Size > 10 Then
            ShowProgressBar(True, i / Timerlist.Size)
            Sleep(0)
        End If
       
        If MyIndex <> ClvIndex Then Return
    Next
   
    ShowProgressBar(False, 0)
End Sub

Private Sub ShowProgressBar(Visible As Boolean, Value As Double)
    pnlProgressBar.BringToFront
    pnlProgressBar.Visible = Visible
    lblProgress.Width = Value * (ProgressBar.Width - 2dip)
End Sub

Application_Start
Application_Active
i=0/16
i=1/16
i=2/2
Error occurred on line: 196 (mInputTimer)
*** -[__NSArrayM objectAtIndex:]: index 2 beyond bounds [0 .. 1]
Stack Trace: (
CoreFoundation DD8145FF-7279-3C33-9B3F-0DA5541DD7F9 + 39472
libobjc.A.dylib objc_exception_throw + 56
CoreFoundation DD8145FF-7279-3C33-9B3F-0DA5541DD7F9 + 1668388
CoreFoundation DD8145FF-7279-3C33-9B3F-0DA5541DD7F9 + 104980
CMM -[B4IList Get:] + 80
CoreFoundation DD8145FF-7279-3C33-9B3F-0DA5541DD7F9 + 458128
CoreFoundation DD8145FF-7279-3C33-9B3F-0DA5541DD7F9 + 128216
CMM +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1400
CMM -[B4IShell runMethod:] + 420
CMM -[B4IShell raiseEventImpl:method:args::] + 1472
CMM -[B4IShellBI raiseEvent:event:params:] + 1360
CMM -[B4IDebugResumableSub resume::] + 352
CMM __21-[B4ICommon Sleep:::]_block_invoke + 56
libdispatch.dylib 9FA81DCE-81CF-3E8B-A1BB-FB64744769B2 + 407632
libdispatch.dylib 9FA81DCE-81CF-3E8B-A1BB-FB64744769B2 + 411592
libdispatch.dylib 9FA81DCE-81CF-3E8B-A1BB-FB64744769B2 + 286488
libdispatch.dylib 9FA81DCE-81CF-3E8B-A1BB-FB64744769B2 + 285584
CoreFoundation DD8145FF-7279-3C33-9B3F-0DA5541DD7F9 + 604184
CoreFoundation DD8145FF-7279-3C33-9B3F-0DA5541DD7F9 + 488600
CoreFoundation CFRunLoopRunSpecific + 584
GraphicsServices GSEventRunModal + 160
UIKitCore 15E101FA-5FF2-39A4-8983-3819CBA1F11D + 3626552
UIKitCore UIApplicationMain + 312
CMM main + 100
dyld EB7391E7-74A5-32DD-8D17-CA86BACE9C2C + 81392
)
 
Upvote 0
Top