Problem description
On iOS 6, a 'className' property is returned as 'TiUIViewProxy' instead of its set value
Steps to reproduce and sample code
Create a View (for example) with a 'className' property, set to a string
Result: instead of the string value, the property value is returned as TiUIViewProxy
This is happening only on iOS 6. On iOS 5.1 the string value is returned.
var win = Ti.UI.createWindow({
backgroundColor : "black",
navBarHidden : false,
title : "Main Window",
});
var view = Ti.UI.createView({
className : 'viewClassname',
height : 200,
width : 200,
id : 'viewID',
backgroundColor : 'orange'
});
Ti.API.info('#### view: ' + JSON.stringify(view));
var label = Ti.UI.createLabel({
className : 'labelClassname',
text : 'Label',
color : 'orange',
top : 20
});
Ti.API.info('#### view: ' + JSON.stringify(label));
win.add(view);
win.add(label);
win.open();
Log:
[INFO] #### view: {"className":"TiUIViewProxy","width":200,"horizontalWrap":true,"id":"viewID","backgroundColor":"orange","height":200}
[INFO] #### view: {"className":"TiUILabelProxy","top":20,"horizontalWrap":true,"text":"Label","color":"orange"}
PR https://github.com/appcelerator/titanium_mobile/pull/3375
3_0_X PR https://github.com/appcelerator/titanium_mobile/pull/3409
Apple brought about an internal method, className, to NSObject. If we were to implement className as a method, there is a high chance the apps would get rejected because of this.
And the only real way to test this is to run app validation.
Blain, I ran an app validation process with className defined on NSObject subclass, and it passed with no issues. This confirms the change is safe (yet).
alternative solution provided.
Closing as fixed. Tested and verified with: Titanium Studio, build: 3.0.0.201211301903 Titanium SDK, build: 3.0.0.v20121130200208 Devices: iPad mini iOS 6.0.1 iPad4 iOS 6.0 iPhone5 iOS 6.0