Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6951] iOS: Ti.Platform.displayCaps is undefined

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2012-02-10T00:07:00.000+0000
Affected Version/sRelease 1.8.0.1
Fix Version/sn/a
ComponentsiOS
Labelsparity, regression
ReporterKevin Whinnery
AssigneeStephen Tramer
Created2012-01-02T10:29:59.000+0000
Updated2012-02-10T00:07:00.000+0000

Description

In 1.8.0.1 Ti.Platform.displayCaps is undefined on iOS. It's not critical, since iOS does not need that information so much as Android does, but either the information should be provided, or the cross-platform limitations should be documented.

Comments

  1. Stephen Tramer 2012-01-04

    This ticket requires a test case before it can be resolved. DisplayCaps is not undefined or null under normal circumstances, as in this test app:
       var caps = Ti.Platform.displayCaps;
       Ti.API.info(caps.density);
       Ti.API.info(caps.dpi);
       Ti.API.info(caps.platformWidth);
       Ti.API.info(caps.platformHeight);
       
  2. Paul Dowsett 2012-01-06

    I cannot reproduce the issue with displayCaps on iPhone simulator + iOS5 with either 1.8.0.1 or 1.7.5. However, when it is spelled with a capital, DisplayCaps, is it undefined. See errors:
       [INFO] ImageViewTest/1.0 (1.7.5.ab20af7)
       [ERROR] Script Error = Result of expression 'Ti.Platform.DisplayCaps' [undefined] is not an object. at app.js (line 2).
       
       [INFO] ImageViewTest/1.0 (1.8.0.1.fbdc96f)
       [ERROR] Script Error = Result of expression 'Ti.Platform.DisplayCaps' [undefined] is not an object. at app.js (line 2).
       
    On Android 2.2 + 1.8.0.1, it works regardless.
  3. Stephen Tramer 2012-01-09

    As per discussion with Marshall and Opie, the correct API point is Ti.Platform.displayCaps, which matches the documentation. Ti.Platform.DisplayCaps may not even be a valid object on Android.

JSON Source