Question

I've built my app with Titanium Appcelerator. I can build and run my app on iOS Simulator for iPad and iPhone. However, when building to my devices, my iPhone build can't find the files. iPad works fine.

I'm checking for the osname, and setting these variables accordingly to true or false, depending on which device they're running. Like I mentioned, the iPhone simulator loads the file perfectly, but on the iPhone it throws up a bad path error, which means my iPhone variable is being set to true, since it's attempting to find it. Is there something I'm overlooking when building to iPhoen? The code looks like this:

var ipad = false;
var iphone = false;
var iOSCheck = function(){
if(Titanium.Platform.osname == 'ipad'){
    ipad = true;
    Titanium.include('games/views/ipad/options.js');
} else if(Titanium.Platform.osname == 'iphone'){
    iphone = true;
    Titanium.include('games/views/iphone/options.js');
} 
    if(iphone || ipad){
        Titanium.UI.iPhone.statusBarStyle = Titanium.UI.iPhone.StatusBar.OPAQUE_BLACK;
    }
}

EDIT: I've edited the code to show a more specific senario of what I have.

Was it helpful?

Solution

I solved the issue. It turns out that the only reason it wouldn't work was because the folder was named 'iphone'. Perhaps this conflicts with the default iphone folder where the images are? Regardless, I renamed the folder to phone and it works fine now. Very strange.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top