User Tag List

Results 1 to 9 of 9

Thread: 'Terminating app due to NSRangeException'

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    MJK's Avatar
    Join Date
    Jun 2006
    Location
    Espoo, Finland
    Posts
    1,162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    'Terminating app due to NSRangeException'

    Any clues what could be the reason behind this type of error in Xcode which crashes the app? Does this give any indication on what object it could relate to? My guess would be either arrays, loops or advanced game board object...

    *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSCFString substringFromIndex:]: Range or index out of bounds'
    *** Call stack at first throw:
    (
    0 CoreFoundation 0x32eb964f __exceptionPreprocess + 114
    1 libobjc.A.dylib 0x35891c5d objc_exception_throw + 24
    2 CoreFoundation 0x32eb9491 +[NSException raise:format:arguments:] + 68
    3 CoreFoundation 0x32eb94cb +[NSException raise:format:] + 34
    4 Foundation 0x356940a9 -[NSString substringFromIndex:] + 92
    5 gg4 0x0006ff79 expSys_RIGHT + 260
    6 gg4 0x0008228d callExp_Systeme + 68
    7 gg4 0x0010e913 -[CRun getExpression] + 374
    8 gg4 0x0010e6b3 -[CRun get_ExpressionString] + 78
    9 gg4 0x0006fd41 expSys_LEFT + 60
    10 gg4 0x0008228d callExp_Systeme + 68
    11 gg4 0x0010e82d -[CRun getExpression] + 144
    12 gg4 0x0010e57d -[CRun get_EventExpressionString:] + 144
    13 gg4 0x000711eb actTxtSetString + 130
    14 gg4 0x00080a25 callAction_Text + 124
    15 gg4 0x0002a78d -[CEventProgram call_Actions:] + 644
    16 gg4 0x00029a8f -[CEventProgram computeEventList:withObject:] + 598
    17 gg4 0x00029543 -[CEventProgram compute_TimerEvents] + 638
    18 gg4 0x0010a035 -[CRun f_GameLoop] + 1760
    19 gg4 0x000fb69b -[CRun doRunLoop] + 102
    20 gg4 0x0000bf8b -[CRunApp loopFrame] + 78
    21 gg4 0x0000aa29 -[CRunApp playApplication:] + 1092
    22 gg4 0x0000451b -[CRunView timerEntry] + 126
    23 Foundation 0x357227cd __NSFireTimer + 136
    24 CoreFoundation 0x32e90a47 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUN CTION__ + 14
    25 CoreFoundation 0x32e92ecb __CFRunLoopDoTimer + 850
    26 CoreFoundation 0x32e93845 __CFRunLoopRun + 1088
    27 CoreFoundation 0x32e23ec3 CFRunLoopRunSpecific + 230
    28 CoreFoundation 0x32e23dcb CFRunLoopRunInMode + 58
    29 GraphicsServices 0x35cee41f GSEventRunModal + 114
    30 GraphicsServices 0x35cee4cb GSEventRun + 62
    31 UIKit 0x32a40d69 -[UIApplication _run] + 404
    32 UIKit 0x32a3e807 UIApplicationMain + 670
    33 gg4 0x00002e15 main + 88
    34 gg4 0x00002db8 start + 40
    )
    terminate called after throwing an instance of 'NSException'

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    MJK's Avatar
    Join Date
    Jun 2006
    Location
    Espoo, Finland
    Posts
    1,162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I isolated this error to a couple of events involving changing of alterable string to show data from a text array:

    Start of frame
    - Change alterable string to Left$(Upper$(Left$(StrAtXY( "array 1", 35, 2), 1))+Right$(StrAtXY( "array 1", 35, 2), Len(StrAtXY( "array 1", 35, 2))-1), Len(Upper$(Left$(StrAtXY( "array 1", 35, 2), 1))+Right$(StrAtXY( "array 1", 35, 2), Len(StrAtXY( "array 1", 35, 2))-1))-4)

    Start of frame
    - Change alterable string to "Level #"+Str$(global value A+1)+" | "+StrAtXY( "array 1", 35, 0)+" x "+StrAtXY( "array 1", 35, 1)+" grid | "+StrAtXY( "array 1", 35, 3)


    Xcode shows e.g. the following and highlights some of these lines in the code:

    Thread 1: Program received signal: "SIGABRT".

    string=[string substringFromIndex:len-pos];

    expSysteme[rhPtr->rh4ExpToken->expCode.expSCode.expNum+3](rhPtr); // Pour sauter les tokens expression negatifs

    callTable_Expression[rh4ExpToken->expCode.expSCode.expType+NUMBEROF_SYSTEMTYPES](self);

    [ret forceString:[[self getExpression] getString]];

    And so on...

    When I remove those couple of events and build the .cci, Xcode doesn't give the errors anymore and the app doesn't crash.

    Could someone please take a look if this crash can be replicated, and then fixed for the next version?

  3. #3
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Francois's Avatar
    Join Date
    Jul 2006
    Location
    Montpellier, France
    Posts
    6,920
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Although this should not happen, it seems that the problem comes from an illegal parameter in the Right$ expression.
    I think you can avoid the problem by using parameters within the range of the string you want to extract.
    Please send me a mfa that demonstrates the problem.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    MJK's Avatar
    Join Date
    Jun 2006
    Location
    Espoo, Finland
    Posts
    1,162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    mfa sent via PM

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    MJK's Avatar
    Join Date
    Jun 2006
    Location
    Espoo, Finland
    Posts
    1,162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Francois, just wondering if you have had time to check my mfa yet? Can this bug be fixed to a future build?

  6. #6
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Francois's Avatar
    Join Date
    Jul 2006
    Location
    Montpellier, France
    Posts
    6,920
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    I'll do it today or tomorow...

  7. #7
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Francois's Avatar
    Join Date
    Jul 2006
    Location
    Montpellier, France
    Posts
    6,920
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Corrected : the Left$ and Right$ expressions crashed when given a negative parameter.

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    MJK's Avatar
    Join Date
    Jun 2006
    Location
    Espoo, Finland
    Posts
    1,162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Excellent, thanks. I'll wait for the next build. Will the fix be in 255 or some pre-255 beta build?

  9. #9
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Francois's Avatar
    Join Date
    Jul 2006
    Location
    Montpellier, France
    Posts
    6,920
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    In both.

Similar Threads

  1. terminating an mp3
    By life2searching in forum XNA Export Module Version 2.0
    Replies: 1
    Last Post: 25th July 2011, 06:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •