Titanium 消息="';未定义';不是函数(计算';bookview.open()';)”;钛合金
我是泰坦尼克号的新手,目前正在跟随官方的脚步,但我在这个阶段就开始了Titanium 消息="';未定义';不是函数(计算';bookview.open()';)”;钛合金,titanium,titanium-mobile,titanium-alloy,Titanium,Titanium Mobile,Titanium Alloy,我是泰坦尼克号的新手,目前正在跟随官方的脚步,但我在这个阶段就开始了 function showBook(event) { var selectedBook = event.source;var args = { title: selectedBook.title, author: selectedBook.author }; var bookview = Alloy.createController("bookdetails", args
function showBook(event) {
var selectedBook = event.source;var args = {
title: selectedBook.title,
author: selectedBook.author
};
var bookview = Alloy.createController("bookdetails", args).getView();
bookview.open();
}
当我尝试使用ios模拟器运行时,我有点陷入了上面的阶段,出现了以下错误
Script Error {
[ERROR] : backtrace = "#0 () at :0";
[ERROR] : line = 27;
[ERROR] : message = "'undefined' is not a function (evaluating 'bookview.open()')";
[ERROR] : name = TypeError;
[ERROR] : sourceId = 344963552;
[ERROR] : sourceURL = "file:///Users/hivelocity/Library/Application%20Support/iPhone%20Simulator/7.1/Applications/6B8062FB-B379-407A-8553-184EED274850/FaveBooks.app/alloy/controllers/index.js";
[ERROR] : }
确保bookdetails是一个窗口而不是视图
要进行检查,只需打开bookdetails.xml并检查窗口的标记是否存在。但如果它是一个窗口,并且我遇到了相同的错误,该怎么办?