“加载路径错误”与“url”在创建窗口中
我在 app.js
中有这段代码:
var login = Ti.UI.createWindow({
url: 'controllers/loginController.js'
});
login.open();
在 Titanium 文档中,它是关于 url
属性的:
可以通过指定从另一个 JavaScript 文件加载 Windows 属性 url,引用与您的应用程序相关的文件 资源文件夹。
我的 controllers
文件夹位于 Resources
文件夹内。我仔细检查了:)!
我按照此处的步骤操作:
http://blog.scottmontgomerie.com/01/mvc -in-appcelerator/
在他的示例项目中,他做了同样的事情。
但是,我总是收到以下错误消息:
[ERROR] 加载路径错误:/Users/mobiel/Library/Application Support/iPhone
模拟器/5.0/Applications/3DD8FFEF-4DD7-437E-8AE5-6851750FA0F8/teamTaskManager.app/Resources/controllers/loginController.js, 错误域 = NSCocoaErrorDomain 代码 = 260 “该操作无法 完全的。 (可可错误 260。)” UserInfo=0xa385b60 {NSFilePath=/Users/mobiel/Library/Application Support/iPhone 模拟器/5.0/Applications/3DD8FFEF-4DD7-437E-8AE5-6851750FA0F8/teamTaskManager.app/Resources/controllers/loginController.js, NSUnderlyingError=0xa385aa0“操作无法完成。否 这样的文件或目录”}
有什么想法吗?提前致谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过从项目目录中删除
build
文件夹并重新构建项目来修复此问题。:|
I fixed this by deleting the
build
folder from my project directory and re-building the project.:|