I have this code in app.js
:
var login = Ti.UI.createWindow({
url: 'controllers/loginController.js'
});
login.open();
In the Titanium documentation, it says this about the url
property:
Windows can be loaded from another JavaScript file by specifying the property url, referencing a file relative to your application Resources folder.
My controllers
folder is inside the Resources
folder. I doublechecked :)!
I was following the steps here:
http://blog.scottmontgomerie.com/01/mvc-in-appcelerator/
In his example project, he does the same.
However, I always get the following error message:
[ERROR] error loading path: /Users/mobiel/Library/Application Support/iPhone
Simulator/5.0/Applications/3DD8FFEF-4DD7-437E-8AE5-6851750FA0F8/teamTaskManager.app/Resources/controllers/loginController.js, Error Domain=NSCocoaErrorDomain Code=260 "The operation couldn’t be completed. (Cocoa error 260.)" UserInfo=0xa385b60 {NSFilePath=/Users/mobiel/Library/Application Support/iPhone Simulator/5.0/Applications/3DD8FFEF-4DD7-437E-8AE5-6851750FA0F8/teamTaskManager.app/Resources/controllers/loginController.js, NSUnderlyingError=0xa385aa0 "The operation couldn’t be completed. No such file or directory"}
Any idea? Thanks in advance.
I fixed this by deleting the build
folder from my project directory and re-building the project.
:|