[英]JQM/Phonegap native app stuck at splash screen when run on Iphone simulator from xcode
This guy seems to have a similar problem, except mine doesn't work at all, not just on the first try. 这个家伙似乎也有类似的问题,除了我的根本不工作,而不仅仅是第一次尝试。 Today I installed xcode 4.2/ios simulator 5.0 hoping that would fix the problem, but it hasn't helped.
今天,我安装了xcode 4.2 / ios模拟器5.0,希望可以解决此问题,但并没有帮助。 The app has consistently run on actual devices, but all the developers who own Iphones are out of the office today and the company ipod is in use elsewhere.
该应用程序一直在实际设备上运行,但是拥有Iphone的所有开发人员今天都不在办公室里,并且公司ipod在其他地方也正在使用。
I've tried closing both xcode and the ios simulator, changing between 5.0 and 4.3, changing between regular iphone and iphone retina, trying with simulator running first and trying with simulator closed first. 我试过关闭xcode和ios模拟器,在5.0和4.3之间切换,在常规的iphone和iphone视网膜之间切换,先尝试运行模拟器,然后先关闭模拟器。 It just sits there on the loading screen.
它只是位于加载屏幕上。 As far as I know the simulator has never worked, I'm not the one who setup xcode or any of the devices (he doesnt work on Mondays and didn't know how to fix it on Friday anyway).
据我所知,模拟器从未使用过,我不是设置xcode或任何设备的人(他在星期一不工作,也不知道在星期五如何修复它)。 Any help would be appreciated.
任何帮助,将不胜感激。
Turns out adding "localHosts" to ExternalHosts fixed the Simulator, but the simulator doesn't like the ajax call to our services site, so it still isn't working, but now at least we have an acceptable reason for it. 事实证明,将“ localHosts”添加到ExternalHosts修复了模拟器,但模拟器不喜欢对我们服务站点的ajax调用,因此它仍然无法正常工作,但是至少现在我们有一个可以接受的理由。 (Devices work correctly, so it isn't that big of a deal) Hope this helps someone.
(设备可以正常工作,所以没什么大不了的)希望这对某人有帮助。
If anyone can think of a way for the simulator to work with the reference to external calls I'll transfer the answer to their answer :P. 如果有人能想到模拟器可以参考外部呼叫的方式,我将把答案转移给他们的答案:P。
Like Luke said in a comment to you: just use JSONP . 就像Luke在给您的评论中说的那样: 只需使用JSONP即可 。
It's not the simulator's fault, that's just how browsers work. 这不是模拟器的错,这只是浏览器的工作方式。 They don't allow cross-domain ajax requests.
他们不允许跨域的ajax请求。 That's why there is a solution to this problem, namely JSONP.
这就是为什么有一个解决方案,即JSONP。 In essence, the response must be a regular JSON object that is enclosed in a function call, something like
callback_function({json: 'object'})
. 本质上,响应必须是包含在函数调用中的常规JSON对象,类似于
callback_function({json: 'object'})
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.