Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11620] iOS 6: 'className' property is returned as TiUIObjectProxy

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-11-21T23:19:07.000+0000
Affected Version/sRelease 2.1.3
Fix Version/sRelease 3.0.0, Release 3.1.0, 2012 Sprint 24, 2012 Sprint 24 Core
ComponentsiOS
LabelsSupportTeam, module_view, qe-manualtest, regression, triage
ReporterFederico Casali
AssigneeMax Stepanov
Created2012-10-31T01:27:40.000+0000
Updated2014-08-14T07:58:27.000+0000

Description

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"}

Comments

  1. Max Stepanov 2012-11-03

    PR https://github.com/appcelerator/titanium_mobile/pull/3375
  2. Max Stepanov 2012-11-12

    3_0_X PR https://github.com/appcelerator/titanium_mobile/pull/3409
  3. Blain Hamon 2012-11-13

    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.
  4. Max Stepanov 2012-11-13

    And the only real way to test this is to run app validation.
  5. Max Stepanov 2012-11-16

    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).
  6. Max Stepanov 2012-11-21

    alternative solution provided.
  7. Olga Romero 2012-12-04

    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

JSON Source