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

iOS: Picker Column removeRow Throws Unexpected Argument Exception

    Details

      Description

      {html}<div><h1>Problem</h1>
      <p>Calling removeRow on a picker column throws an Unexpected
      Argument Exception.</p>
      <h1>Sample Code</h1>
      <p>The following code shows a picker. If you tap on the
      non-selected row, removeRow will be called on the first row in the
      picker.</p>
      <pre>
      <code class=
      "javascript">var win = Ti.UI.createWindow({ backgroundColor: '#fff' });

      var picker = Titanium.UI.createPicker();
      var rows = [
      Titanium.UI.createPickerRow({title:'Bananas'}),
      Titanium.UI.createPickerRow({title:'Strawberries'}),
      Titanium.UI.createPickerRow({title:'Mangos'}),
      Titanium.UI.createPickerRow({title:'Grapes'})
      ];
      picker.add(rows);
      picker.addEventListener('change', function(evt) {
      var column = picker.getColumns()[0];
      column.removeRow(column.rowAt(0));
      });

      win.add(picker);
      win.open();</code>
      </pre>
      <h1>Exception</h1>
      <pre>
      <code>[ERROR] Invalid type passed to function. expected: NSNull, was: TiUIPickerRowProxy in -[TiUIPickerColumnProxy removeRow:] (TiUIPickerColumnProxy.m:57)
      [ERROR] The application has crashed with an unhandled exception. Stack trace:
      0 CoreFoundation 0x02254bcc __exceptionPreprocess + 156
      1 libobjc.A.dylib 0x023a95c2 objc_exception_throw + 47
      2 Playground2 0x0009c1a4 -[TiProxy throwException:subreason:location:] + 478
      3 Playground2 0x00115067 -[TiUIPickerColumnProxy removeRow:] + 514
      4 CoreFoundation 0x021c567d _invoking__ + 29
      5 CoreFoundation 0x021c5551 -[NSInvocation invoke] + 145
      6 Playground2 0x00039321 -[KrollMethod call:] + 2092
      7 Playground2 0x000386d3 KrollCallAsFunction + 327
      8 Playground2 0x0028b058 _ZN2TI16TiCallbackObjectINS_8TiObjectEE4callEPNS_10TiExcStateEPS1_NS_7TiValueERKNS_7ArgListE + 552
      9 Playground2 0x0024ef28 cti_op_call_NotTiFunction + 632
      10 ??? 0x0b0f2aa3 0x0 + 185543331
      11 Playground2 0x001fe69b _ZN2TI11Interpreter7executeEPNS_18FunctionExecutableEPNS_10TiExcStateEPNS_10TiFunctionEPNS_8TiObjectERKNS_7ArgListEPNS_14ScopeChainNodeEPNS_7TiValueE + 971
      12 Playground2 0x0026a8ff _ZN2TI10TiFunction4callEPNS_10TiExcStateENS_7TiValueERKNS_7ArgListE + 127
      13 Playground2 0x001ae529 _ZN2TI4callEPNS_10TiExcStateENS_7TiValueENS_8CallTypeERKNS_8CallDataES2_RKNS_7ArgListE + 57
      14 Playground2 0x002873d4 TiObjectCallAsFunction + 612
      15 Playground2 0x0003317e -[KrollCallback call:thisObject:] + 784
      16 Playground2 0x00034395 -[KrollEvent invoke:] + 92
      17 Playground2 0x00033a26 -[KrollContext invoke:] + 43
      18 Playground2 0x00035243 -[KrollContext main] + 3216
      19 Foundation 0x005eed4c -[NSThread main] + 81
      20 Foundation 0x005eecd8 _NSThreadmain_ + 1387
      21 libSystem.B.dylib 0x97f7e85d _pthread_start + 345
      22 libSystem.B.dylib 0x97f7e6e2 thread_start + 34
      2011-02-03 12:10:00.806 Playground2[65343:6003] *** Terminating app due to uncaught exception 'org.playground2.TiUIPickerColumnProxy', reason: 'Invalid type passed to function. expected: NSNull, was: TiUIPickerRowProxy in -[TiUIPickerColumnProxy removeRow:] (TiUIPickerColumnProxy.m:57)'
      *** Call stack at first throw:
      (
      0 CoreFoundation 0x02254be9 __exceptionPreprocess + 185
      1 libobjc.A.dylib 0x023a95c2 objc_exception_throw + 47
      2 Playground2 0x0009c1a4 -[TiProxy throwException:subreason:location:] + 478
      3 Playground2 0x00115067 -[TiUIPickerColumnProxy removeRow:] + 514
      4 CoreFoundation 0x021c567d _invoking__ + 29
      5 CoreFoundation 0x021c5551 -[NSInvocation invoke] + 145
      6 Playground2 0x00039321 -[KrollMethod call:] + 2092
      7 Playground2 0x000386d3 KrollCallAsFunction + 327
      8 Playground2 0x0028b058 _ZN2TI16TiCallbackObjectINS_8TiObjectEE4callEPNS_10TiExcStateEPS1_NS_7TiValueERKNS_7ArgListE + 552
      9 Playground2 0x0024ef28 cti_op_call_NotTiFunction + 632
      10 ??? 0x0b0f2aa3 0x0 + 185543331
      11 Playground2 0x001fe69b _ZN2TI11Interpreter7executeEPNS_18FunctionExecutableEPNS_10TiExcStateEPNS_10TiFunctionEPNS_8TiObjectERKNS_7ArgListEPNS_14ScopeChainNodeEPNS_7TiValueE + 971
      12 Playground2 0x0026a8ff _ZN2TI10TiFunction4callEPNS_10TiExcStateENS_7TiValueERKNS_7ArgListE + 127
      13 Playground2 0x001ae529 _ZN2TI4callEPNS_10TiExcStateENS_7TiValueENS_8CallTypeERKNS_8CallDataES2_RKNS_7ArgListE + 57
      14 Playground2 0x002873d4 TiObjectCallAsFunction + 612
      15 Playground2 0x0003317e -[KrollCallback call:thisObject:] + 784
      16 Playground2 0x00034395 -[KrollEvent invoke:] + 92
      17 Playground2 0x00033a26 -[KrollContext invoke:] + 43
      18 Playground2 0x00035243 -[KrollContext main] + 3216
      19 Foundation 0x005eed4c -[NSThread main] + 81
      20 Foundation 0x005eecd8 _NSThreadmain_ + 1387
      21 libSystem.B.dylib 0x97f7e85d _pthread_start + 345
      22 libSystem.B.dylib 0x97f7e6e2 thread_start + 34
      )
      terminate called after throwing an instance of 'NSException'
      [DEBUG] Session did end with error (null)
      [INFO] Application has exited from Simulator</code>
      </pre>
      <h1>Tested On</h1>
      <p>Titanium SDK version: 1.6.0 (02/02/11 15:22 a02f7db...), also
      1.5.1<br>
      BROKEN on iPhone Simulator 4.2</p>
      <h2>Associated Helpdesk Ticket</h2>
      <p><a href=
      "http://developer.appcelerator.com/helpdesk/view/69891">http://developer.appcelerator.com/helpdesk/view/69891</a></p></div>{html}

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                blainhamon Blain Hamon
                Reporter:
                dtoth Dawson Toth
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Integration