2013-01-24 56 views
0

我试图让XZing我的PhoneGap的iPhone应用程序运行:PhoneGap的QR码扫描通过XZing

做了一些研究之后,我发现这个链接,最好的说明安装XZing我的应用程序:

Why can't XCode 4 find my .h files during a build?

我完成了这些步骤并运行了没有错误的应用程序。

现在我尝试运行的扫描仪和我用的是BarcodeScanner测试文件,这里是我的代码

<!DOCTYPE html> 

<html> 
    <head> 
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
     <meta name="format-detection" content="telephone=no" /> 
     <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" /> 
     <link rel="stylesheet" type="text/css" href="css/index.css" /> 
     <title>Hello World</title> 
    </head> 
    <body onLoad="onLoad()"> 
     <div class="app"> 
      <div id="running-bits"> 

<button id="scan-button">scan: ?</button> 

<p>(<span id="test-count-current">?</span> 
/
<span id="test-count-total">?</span>) 

<p><img id="image" src=""> 

<p>expected text: 
<br><tt><span id="test-text">?</span></tt> 

</div> 

<p><b id="test-done"></b> 
<br><button id="start-over">start over</button> 

<p>Results: 
<ul id="results-list"> 
</ul> 
     </div> 
     <script type="text/javascript" src="cordova-2.3.0.js"></script> 
     <script src="js/barcodescanner.js"></script> 
     <script src="js/phonegap-app.js"></script> 
     <script type="text/javascript" src="js/index.js"></script> 
     <script type="text/javascript"> 
      app.initialize(); 
     </script> 
    </body> 
</html> 

在下面的链接的PhoneGap-app.js代码:

https://github.com/phonegap/phonegap-plugins/blob/master/iPhone/BarcodeScanner/test/phonegap-app/phonegap-app.js

但是,当我点击扫描按钮扫描仪,它失败了,我得到这个错误在日志中:

BarcodeScanner失败:excep重刑扫描:类型错误:“未定义”不是一个对象

+0

为什么你不使用iOS的BarcodeScanner插件? –

回答

1

你可以试试下面的事情:
1)改变Cordova.plist和barcodescanner javascript文件字符串“org.apache.cordova.barcodeScanner”到“CDVBarcodeScanner” 。
2)在barcodescanner.js中:
a)将科尔多瓦改为科尔多瓦
b)开始时用hasResource和addResource注释行。

希望这会有所帮助。

+0

我终于修好了,我会上传整个项目,这样每个人都可以使用它 –