Issue
Looks like a property of a proxy is read only in iOS
Droid console output
[INFO][TiAPI ( 338)] Should say "first": first
[INFO][TiAPI ( 338)] Should say "second": second
iOS console output
[INFO] Should say "first": first
[INFO] Should say "second": first
Simple repro snippet
var win = Ti.UI.createWindow({
backgroundColor: 'white'
});
var obj = {
_data: [
{one: 'one'},
{two:'two'},
{three:'three'},
{four:'four'},
{five:'five'}
],
width:100,
height: 100,
backgroundColor: 'red'
}
var view = Ti.UI.createView({
_data: [
{one: 'one'},
{two:'two'},
{three:'three'},
{four:'four'},
{five:'five'}
],
width:100,
height: 100,
backgroundColor: 'red',
_myname:[ 'first' ] // this is view._myname[0]
});
win.add(view);
win.open();
Ti.API.info('Should say "first": ' + view._myname[0]);
view._myname[0] = 'second';
Ti.API.info('Should say "second": ' + view._myname[0]);
Tested on
iOS 5.1 simulator
Droid Razr 2.3.5
Issue reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 iOS iPhone Simulator: iOS SDK version: 6.0
Just a comment while we look into this. A Titanium proxy is not a regular JS object. Any custom properties added to a proxy are internally copied and converted into native value, such as NSArray, for example. The values of these properties become read-only until overwritten. To solve this issue for now, do the following
Closing for cleaning up legacy tickets purpose. As mentioned above, this is expected bevariour. Workaround