Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23191] iOS: Non-string PickerRow titles (integer,bool, ..) causing crash

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-04-11T22:54:30.000+0000
Affected Version/sRelease 5.2.2
Fix Version/sRelease 5.4.0
ComponentsiOS
Labelsios, picker, pickerrow, qe-5.4.0
ReporterKelly Corn
AssigneeHans Knöchel
Created2016-04-11T21:00:51.000+0000
Updated2016-06-21T17:44:41.000+0000

Description

Steps to reproduce 1. Create a Picker with 2 columns 2. PickerRow title set to "0" in XML (or "1", "2", etc) 3. App crashes immediately Setting the PickerRow title to "0" in the controller js works fine. Android either method works fine. *index.xml*
<Alloy>
   <Window class="container">
      <View top="10" layout="vertical" height="Ti.UI.SIZE" width="Ti.UI.FILL">
        <Label color="white">How Much To Add?</Label>
        <Picker id="timeAmount" useSpinner="true">
          <PickerColumn id="hours" width="50%">
            <PickerRow title="0"/>
            <PickerRow title="1"/>
            <PickerRow title="2"/>
            <PickerRow title="3"/>
            <PickerRow title="4"/>
          </PickerColumn>
          <PickerColumn id="min" width="50%">
            <PickerRow title=".00"/>
            <PickerRow title=".25"/>
            <PickerRow title=".50"/>
            <PickerRow title=".75"/>
          </PickerColumn>
        </Picker>
      </View>
	</Window>
</Alloy>
*index.js* $.index.open();

Comments

  1. Hans Knöchel 2016-04-11

    [~fokkezb] I remember we had a similar issue not too long ago. Do you know more? Anyway, the fix should be easy by wrapping the String correctly.
  2. Hans Knöchel 2016-04-11

    PR: https://github.com/appcelerator/titanium_mobile/pull/7935 Demo:
        
       var win = Ti.UI.createWindow({backgroundColor: "white"});
       var picker = Ti.UI.createPicker();
       
       var data = [];
       data[0]=Ti.UI.createPickerRow({title:12});
       data[1]=Ti.UI.createPickerRow({title:true});
       data[2]=Ti.UI.createPickerRow({title:-1});
       data[3]=Ti.UI.createPickerRow({title:'Grapes'});
       
       picker.add(data);
       picker.selectionIndicator = true;
       
       win.add(picker);
       win.open();
       
  3. Fokke Zandbergen 2016-04-12

    [~hansknoechel] yes, TIMOB-23130 - both caused by ALOY-1355.
  4. Harry Bryant 2016-06-21

    Verified as fixed, Creating PickerRows with Non-String titles no longer causes an app to crash, tested both with classic & alloy mobile projects. Tested On: iPhone 6S (9.3.2) Device Mac OSX El Capitan 10.11.5 Ti SDK: 5.4.0.v20160617074028 Appc Studio: 4.7.0.201606150733 Appc NPM: 4.2.7-2 App CLI: 5.4.0-18 Xcode 7.3 Node v4.2.6 *Closing ticket.*

JSON Source