To reproduce
1. Create an app for BB with the following code:
var win = Titanium.UI.createWindow();
var scroll = Ti.UI.createScrollView({
backgroundColor: 'green',
width: Ti.UI.FILL,
height: Ti.UI.FILL,
layout: 'vertical',
contentHeight:Ti.UI.SIZE,
contentWidth:Ti.UI.SIZE
});
function MyButton(text) {
return Ti.UI.createLabel({
text: text,
top: 10,
//width:50
});
}
for(var i = 0; i < 100; i++) {
scroll.add(MyButton('Label #' + (i + 1)));
}
win.add(scroll);
win.open();
2. Build it for BB device/simulator
3. launch the app & observe the labels
Actual result
*Note* Simulator does not have this issue
Different labels are missing when building to device continuously
PR for 3.2.x: https://github.com/appcelerator/titanium_mobile_blackberry/pull/197
PR for master: https://github.com/appcelerator/titanium_mobile_blackberry/pull/198
The problem is that a JS value comes in for the key of the object:
In this case the "text" property. To convert it to a c++ const char* we were using the function V8StringToQString(Handle
Tested and verified the fix with: Appcelerator Studio, build: 3.2.0.201312162210 Titanium SDK, build: 3.2.0.v20131216191854 CLI 3.2.0-cr3 Alloy 1.3.0-cr2 BBZ10 10.1.0 No more missing labels.