Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-5212

Files in the project root's Resources/iphone folder cannot be loaded by the iOS simulator

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Low
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: iOS
    • Environment:
      • Titanium Studio, build: 1.0.4.201108101535
      • Titanium Mobile SDK 1.7.2
      • XCode 4.1 Build 4B110
      • iOS SDK 4.3
      • Mac OS X 10.7.1

      Description

      Platform-specific images are placed in the following project directories:

      Resources/android/images/high/ic_tab_home.png
      Resources/android/images/medium/ic_tab_home.png
      Resources/android/images/low/ic_tab_home.png
      Resources/iphone/images/ic_tab_home.png
      Resources/iphone/images/ic_tab_home@2x.png
      

      These are used to set icons to tabs, in the following working code:

      app.js

      var tabGroup = Ti.UI.createTabGroup();
       
      var win1 = Ti.UI.createWindow({
        title:'Tab 1',
        backgroundColor:'#fff'
      });
      var tab1 = Ti.UI.createTab({
        icon:"/images/ic_tab_home.png",
        title:'Tab 1',
        top:0,
        left:0,
        right:0,
        bottom:0,
        width:'100%',
        height:'100%',
        window:win1
      });
       
      tabGroup.addTab(tab1);
       
      tabGroup.open();
      

      When the iPhone version of builder.py launches the iOS simulator, it does so in a manner causing the app resources to be loaded from the project root folder instead of the app's resource folder in the iphone build folder. This is causing significant issues when loading device specific resources residing in the Resources/iphone folder. For instance, attempting to load the file Resources/iphone/images/KS_nav_ui.png using the path images/KS_nav_ui.png or /images/KS_nav_ui.png no longer works. If you put them in a top level /images folder, they end up overriding their Android density-specific counterparts when the Android version of builder.py runs.

      It appears builder.py is correctly copying files from the Resources/iphone folder to the app's resource folder residing at build/iphone/build/Debug-iphonesimulator/appname.app. For instance, the file Resources/iphone/images/KS_nav_ui.png is correctly copied to build/iphone/build/Debug-iphonesimulator/appname.app/images/KS_nav_ui.png. But since the iOS simulator is loading the resources directly from the project root, the files in the app resource folder are ignored.

      At present... there doesn't appear to be a graceful workaround to this issue without creating a device specific path at runtime and ingesting it into each path reference for device-specific resources, a significant change to any existing codebase of medium or larger size.

        Attachments

          Activity

            People

            • Assignee:
              ingo Ingo Muschenetz
              Reporter:
              cintimedia Rob Gabbard
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-4412
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Integration