Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24663] iOS: App with "More" tab crashes on tapping (6.0.4.GA)

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-05-10T16:35:01.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.1.0
ComponentsiOS
LabelsTabGroup, iOS
ReporterToshiro Yagi
AssigneeHans Knöchel
Created2017-05-08T02:47:32.000+0000
Updated2017-05-10T17:49:54.000+0000

Description

You can reproduce this issue very easily: First, build iOS app with more than 6 tabs.
<Alloy>
  <TabGroup>
    <Tab title="tab1">
      <Window class="container">
        <Label id="label">Hello Tab1</Label>
      </Window>
    </Tab>
    <Tab title="tab2">
      <Window class="container">
        <Label id="label">Hello Tab2</Label>
      </Window>
    </Tab>
    <Tab title="tab3">
      <Window class="container">
        <Label id="label">Hello Tab3</Label>
      </Window>
    </Tab>
    <Tab title="tab4">
      <Window class="container">
        <Label id="label">Hello Tab4</Label>
      </Window>
    </Tab>
    <Tab title="tab5">
      <Window class="container">
        <Label id="label">Hello Tab5</Label>
      </Window>
    </Tab>
    <Tab title="tab6">
      <Window class="container">
        <Label id="label">Hello Tab6</Label>
      </Window>
    </Tab>
  </TabGroup>
</Alloy>
Then, tap "More" tab. Error message is: {noformat} [ERROR] The application has crashed with an uncaught exception 'NSInvalidArgumentException'. [ERROR] Reason: [ERROR] -[TiUITabGroup controller]: unrecognized selector sent to instance 0x7fc4c7e0f080 [ERROR] Stack trace: [ERROR] 0 CoreFoundation 0x00000001153f5af3 __exceptionPreprocess + 147 [ERROR] 1 libobjc.A.dylib 0x0000000114991141 objc_exception_throw + 48 [ERROR] 2 CoreFoundation 0x0000000115465134 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132 [ERROR] 3 CoreFoundation 0x000000011537c840 ___forwarding___ + 1024 [ERROR] 4 CoreFoundation 0x000000011537c3b8 _CF_forwarding_prep_0 + 120 [ERROR] 5 TestApp 0x000000010e684adc -[TiUITabGroup handleDidShowTab:] + 588 [ERROR] 6 TestApp 0x000000010e685c86 -[TiUITabGroup tabBarController:didSelectViewController:] + 294 [ERROR] 7 UIKit 0x00000001105a4853 -[UITabBarController _tabBarItemClicked:] + 658 [ERROR] 8 UIKit 0x00000001103a7d22 -[UIApplication sendAction:to:from:forEvent:] + 83 [ERROR] 9 UIKit 0x00000001107ba6f7 -[UITabBar _sendAction:withEvent:] + 566 [ERROR] 10 UIKit 0x00000001103a7d22 -[UIApplication sendAction:to:from:forEvent:] + 83 [ERROR] 11 UIKit 0x000000011052c25c -[UIControl sendAction:to:forEvent:] + 67 [ERROR] 12 UIKit 0x000000011052c577 -[UIControl _sendActionsForEvents:withEvent:] + 450 [ERROR] 13 UIKit 0x00000001107bcdb5 -[UITabBar _buttonUp:] + 113 [ERROR] 14 UIKit 0x00000001103a7d22 -[UIApplication sendAction:to:from:forEvent:] + 83 [ERROR] 15 UIKit 0x000000011052c25c -[UIControl sendAction:to:forEvent:] + 67 [ERROR] 16 UIKit 0x000000011052c577 -[UIControl _sendActionsForEvents:withEvent:] + 450 [ERROR] 17 UIKit 0x000000011052b4b2 -[UIControl touchesEnded:withEvent:] + 618 [ERROR] 18 UIKit 0x000000011041549a -[UIWindow _sendTouchesForEvent:] + 2707 [ERROR] 19 UIKit 0x0000000110416bb0 -[UIWindow sendEvent:] + 4114 [ERROR] 20 UIKit 0x00000001103c37b0 -[UIApplication sendEvent:] + 352 [ERROR] 21 UIKit 0x0000000110ba6adc __dispatchPreprocessedEventFromEventQueue + 2926 [ERROR] 22 UIKit 0x0000000110b9ea3a __handleEventQueue + 1122 [ERROR] 23 CoreFoundation 0x000000011539bc01 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 [ERROR] 24 CoreFoundation 0x00000001153810cf __CFRunLoopDoSources0 + 527 [ERROR] 25 CoreFoundation 0x00000001153805ff __CFRunLoopRun + 911 [ERROR] 26 CoreFoundation 0x0000000115380016 CFRunLoopRunSpecific + 406 [ERROR] 27 GraphicsServices 0x0000000116d00a24 GSEventRunModal + 62 [ERROR] 28 UIKit 0x00000001103a60d4 UIApplicationMain + 159 [ERROR] 29 TestApp 0x000000010e5d2be4 main + 100 [ERROR] 30 libdyld.dylib 0x0000000117f3c65d start + 1 {noformat} SDK 6.0.3.GA works just fine.

Comments

  1. Hans Knöchel 2017-05-08

    The issue was caused by TIMOB-23542 and [this line](https://github.com/appcelerator/titanium_mobile/pull/8663/files#diff-f2ae454ff5230d17288a67677d69fd36L352). We should follow a better approach then nilling a delegate VC. PR (master): https://github.com/appcelerator/titanium_mobile/pull/9028 PR (6_1_X): https://github.com/appcelerator/titanium_mobile/pull/9029 Test-Case:
       /**
        * Create a new Ti.UI.TabGroup.
        */
       var tabGroup = Ti.UI.createTabGroup();
       
       /**
        * Add the two created tabs to the tabGroup object.
        */
       tabGroup.addTab(createTab("Tab 1", "I am Window 1", "assets/images/tab1.png"));
       tabGroup.addTab(createTab("Tab 2", "I am Window 2", "assets/images/tab2.png"));
       tabGroup.addTab(createTab("Tab 3", "I am Window 3", "assets/images/tab2.png"));
       tabGroup.addTab(createTab("Tab 4", "I am Window 4", "assets/images/tab2.png"));
       tabGroup.addTab(createTab("Tab 5", "I am Window 5", "assets/images/tab2.png"));
       tabGroup.addTab(createTab("Tab 6", "I am Window 6", "assets/images/tab2.png"));
       
       /**
        * Open the tabGroup
        */
       tabGroup.open();
       
       /**
        * Creates a new Tab and configures it.
        *
        * @param  {String} title The title used in the Ti.UI.Tab and it's included Ti.UI.Window
        * @param  {String} message The title displayed in the Ti.UI.Label
        * @return {String} icon The icon used in the Ti.UI.Tab
        */
       function createTab(title, message, icon) {
           var win = Ti.UI.createWindow({
               title: title,
               backgroundColor: '#fff'
           });
       
           var label = Ti.UI.createLabel({
               text: message,
               color: "#333",
               font: {
                   fontSize: 20
               }
           });
       
           win.add(label);
       
           var tab = Ti.UI.createTab({
               title: title,
               icon: icon,
               window: win
           });
       
           return tab;
       }
       
  2. Eric Wieber 2017-05-10

    FR Passed, using: MacOS 10.12 (16A323) Studio 4.9.0.201704061825 Ti SDK 6.1.0.v20170509174002 Appc NPM 4.2.9 Appc CLI 6.2.0 Alloy 1.9.11 Xcode 8.3.2 (8E2002) No error encountered when changing tabs on apps with many tabs. Tapping on the "more" tab does not throw an error.
  3. Eric Wieber 2017-05-10

    Fixes verified in builds: 6.1.0.v20170510094004 6.2.0.v20170510100548

JSON Source