Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-2011

Opening new modal window with JS error will crash the app

    Details

      Description

      {html}<div><p>If opening a new modal window via a new javascript file, and
      this javascript file has errors, the iPhone emulator would crash.
      The reason why is that the red alert window is animating on top of
      the modal animation at the same time, thus would run into animation
      exception and crash the emulator.</p>
      <p>For example,</p>
      <p><code>
      var editWin = Ti.UI.createWindow( { url: 'edit.js', title: "Edit", backgroundColor: 'white' } );


      editWin.open({ modal: true, modalStyle: Ti.UI.iPhone.MODAL_PRESENTATION_PAGESHEET, navBarHidden: true });
      </code></p>
      <p>If the "edit.js" has an error, like a null reference exception,
      the app would crash. The stacktrace would be something like this
      ...</p>
      <p>ERROR] Script Error = Can't find variable: contactByIds at
      edit.js (line 68).<br>
      2010-10-05 17:01:21.458 Marrily[8996:207] <strong><em>Assertion
      failure in -[UIWindowController
      transition:fromViewController:toViewController:target:didEndSelector:],
      /SourceCache/UIKit_Sim/UIKit-1262.60.3/UIWindowController.m:182<br>
      <a href="/projects/32238/changesets/ERROR" title=
      "Changeset [ERROR]">[ERROR]</a> The application has crashed with an
      unhandled exception. Stack trace: 0 CoreFoundation 0x03807b7c
      <strong>exceptionPreprocess + 156<br>
      1 libobjc.A.dylib 0x0395740e objc_exception_throw + 47<br>
      2 CoreFoundation 0x037c0238 +[NSException raise:format:arguments:]
      + 136<br>
      3 Foundation 0x0062ae37 -[NSAssertionHandler
      handleFailureInMethod:object:file:lineNumber:description:] +
      116<br>
      4 UIKit 0x00ac944f -[UIWindowController
      transition:fromViewController:toViewController:target:didEndSelector:]
      + 212<br>
      5 UIKit 0x008de10d -[UIViewController
      presentModalViewController:withTransition:] + 2937<br>
      6 Marrily 0x00137079 -[TiApp attachModal:toController:animated:] +
      290<br>
      7 Marrily 0x001370a8 -[TiApp attachModal:toController:animated:] +
      337<br>
      8 Marrily 0x00135b13 -[TiApp showModalController:animated:] +
      231<br>
      9 Marrily 0x0005386c -[TiWindowProxy open:] + 2436<br>
      10 Foundation 0x005af3ca</strong> NSThreadPerformPerform + 251<br>
      11 CoreFoundation 0x037e8faf
      <strong>CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION</strong>
      + 15<br>
      12 CoreFoundation 0x0374739b <strong>CFRunLoopDoSources0 + 571<br>
      13 CoreFoundation 0x03746896</strong> CFRunLoopRun + 470<br>
      14 CoreFoundation 0x03746350 CFRunLoopRunSpecific + 208<br>
      15 CoreFoundation 0x03746271 CFRunLoopRunInMode + 97<br>
      16 GraphicsServices 0x053ee00c GSEventRunModal + 217<br>
      17 GraphicsServices 0x053ee0d1 GSEventRun + 115<br>
      18 UIKit 0x0083eaf2 UIApplicationMain + 1160<br>
      19 Marrily 0x00003b49 main + 362<br>
      20 Marrily 0x00002931 start + 53<br>
      21 ??? 0x00000001 0x0 + 1<br>
      2010-10-05 17:01:21.461 Marrily[8996:207]</em></strong> Terminating
      app due to uncaught exception 'NSInternalInconsistencyException',
      reason: 'Attempting to begin a modal transition from
      <TiErrorController: 0x7ee6590> to <UINavigationController:
      0x7ef0df0> while a transition is already in progress. Wait for
      viewDidAppear/viewDidDisappear to know the current transition has
      completed'<br>
      *** Call stack at first throw: ( 0 CoreFoundation 0x03807b99
      <strong>exceptionPreprocess + 185<br>
      1 libobjc.A.dylib 0x0395740e objc_exception_throw + 47<br>
      2 CoreFoundation 0x037c0238 +[NSException raise:format:arguments:]
      + 136<br>
      3 Foundation 0x0062ae37 -[NSAssertionHandler
      handleFailureInMethod:object:file:lineNumber:description:] +
      116<br>
      4 UIKit 0x00ac944f -[UIWindowController
      transition:fromViewController:toViewController:target:didEndSelector:]
      + 212<br>
      5 UIKit 0x008de10d -[UIViewController
      presentModalViewController:withTransition:] + 2937<br>
      6 Marrily 0x00137079 -[TiApp attachModal:toController:animated:] +
      290<br>
      7 Marrily 0x001370a8 -[TiApp attachModal:toController:animated:] +
      337<br>
      8 Marrily 0x00135b13 -[TiApp showModalController:animated:] +
      231<br>
      9 Marrily 0x0005386c -[TiWindowProxy open:] + 2436<br>
      10 Foundation 0x005af3ca</strong> NSThreadPerformPerform + 251<br>
      11 CoreFoundation 0x037e8faf
      <strong>CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION</strong>
      + 15<br>
      12 CoreFoundation 0x0374739b <strong>CFRunLoopDoSources0 + 571<br>
      13 CoreFoundation 0x03746896</strong> CFRunLoopRun + 470<br>
      14 CoreFoundation 0x03746350 CFRunLoopRunSpecific + 208<br>
      15 CoreFoundation 0x03746271 CFRunLoopRunInMode + 97<br>
      16 GraphicsServices 0x053ee00c GSEventRunModal + 217<br>
      17 GraphicsServices 0x053ee0d1 GSEventRun + 115<br>
      18 UIKit 0x0083eaf2 UIApplicationMain + 1160<br>
      19 Marrily 0x00003b49 main + 362<br>
      20 Marrily 0x00002931 start + 53<br>
      21 ??? 0x00000001 0x0 + 1<br>
      ) terminate called after throwing an instance of 'NSException'</p></div>{html}

        Attachments

          Activity

            People

            • Assignee:
              stephentramer Stephen Tramer
              Reporter:
              alexle Alex Le
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-1784
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code