Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13127] iOS: Properties.setList - Ti.App.Properties.setList cannot save arrays that contain null, undefined, or empty values

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-03-29T04:04:26.000+0000
Affected Version/sRelease 3.0.2, Release 3.1.0
Fix Version/sRelease 3.1.0, 2013 Sprint 07 Core, 2013 Sprint 07
ComponentsiOS
Labelsmodule_app_properties, parity, qe-sdk3.1.0, qe-testadded
ReporterWilson Luu
AssigneeMax Stepanov
Created2013-03-20T01:16:28.000+0000
Updated2013-09-30T09:07:06.000+0000

Description

*Details:* If you use Ti.App.Properties.setList() to save an array that contains null, undefined, or an empty value, then setList() will not save the array and return "Attempt to insert non-property value" message in xcode's console. *This is not a regression. Bug still occurs on 3.0.2.GA.* Also, Ti.App.Properties.setList() works as expected on Android; can save an array that contains null, undefined, or an empty value. *Steps to reproduce:* 1. Install the following Titanium app to an iOS device:
var win = Ti.UI.createWindow({
	backgroundColor: 'white'
});

// same issue if there is null or undefined in the array
var vals = [,42];
Ti.App.Properties.setList('number', vals);

var label = Ti.UI.createLabel({
	text: (Ti.App.Properties.getList('number')[1] + ' monkies'),
	font: { fontSize:48 }
});

win.add(label);
win.open();
2. Launch app *Actual:* iOS will not save vals array and return "Attempt to insert non-property value" message (see log.txt) *Expected:* App should launch with "42 monkies" in the label like in Android (see android.png) *Note:* This issue seems similar to TIMOB-11399

Attachments

FileDateSize
android.png2013-03-20T01:16:29.000+000024929
log.txt2013-03-20T01:16:29.000+0000639

Comments

  1. Max Stepanov 2013-03-26

    PR https://github.com/appcelerator/titanium_mobile/pull/4036
  2. Paras Mishra 2013-04-06

    Ti.App.Properties.setList cannot save arrays that contain null. App launches with "42 monkies" in the label. Verified on: Device : iPad mini, iOS version: 6+ SDK: 3.1.0.v20130405170202 CLI version : 3.1.0-beta OS : MAC OSX 10.7.5 Appcelerator Studio, build: 3.1.0.201304011603 XCode : 4.5.1

JSON Source