我正在开发具有俄语和英语本地化功能的 iPhone 应用程序。
对于本地化,我使用 Localazible.strings 文件,并且还有俄语和英语图像集的副本。
问题是:当我切换语言并且应用程序在后台运行,然后我尝试运行应用程序时,它崩溃了,iPhone重新启动,然后开始一遍又一遍地重新启动。只有关闭然后再打开才有帮助。完成后我可以用任何语言运行应用程序。
当应用程序崩溃时,调试器仅显示“程序收到信号 0”。
我如何才能获得此类设备行为的原因?这些问题出现在装有 iOS 4.1(越狱)的 iPhone 3gs、装有 iOS 4.2.1 的 iPad、iPhone 4 iOS 4.3.3 上,但不会出现在 iPhone 4 iOS 4.2.1 上。
I'm developing iphone application with localization in Russian and English languages.
For localization I use Localazible.strings file, and also have a copy of Russian and English set of images.
The problem is: when I switch language and application is running in background, and then I'm trying to run application, it crashes, iphone reboots, and starts rebooting over and over. Only switching off and then switching on helps. After doing it I can run application in any language.
When application crashes debugger says only "program received signal 0".
How can I get reasons of such device behavior? These problem occurs on iphone 3gs with iOS 4.1 (jailbreak), iPad with iOS 4.2.1, iPhone 4 iOS 4.3.3 and DON'T occurs on iPhone 4 iOS 4.2.1.
发布评论
评论(1)
当您在通过 Xcode 调试应用程序时更改语言时,该应用程序会被系统终止(在重新启动期间),并且调试器会将其解释为
sigkill
,这就是它告诉您的内容 - “程序接收到信号 0”。因为调试器已经看到你的应用程序被杀死,所以需要在再次运行它之前从 Xcode 中停止它,否则你会得到看起来像启动时崩溃的错误以及其他此类错误,例如“管道损坏”或“无法启动调试器” ,也许它挂在另一个进程中”。
更改语言时,您将无法测试正常的“从后台恢复”,因为更改语言会重新启动跳板,因此您的应用程序会被终止。
如果您手动维护 UI 状态(如多任务处理之前所需的那样),那么您可以在下次启动应用程序时恢复它并保持多任务处理的错觉。
When you change the language while debugging an app through Xcode, the app is killed by the system (during the reboot) and the debugger interprets that as a
sigkill
, which is what it is telling you - "program received signal 0".Because the debugger has seen your app killed, it needs to be stopped from within Xcode before you can run it again, other wise you get what looks like a crash on launch and other such errors like "broken pipe" or "unable to start debugger, maybe it is hung in another process".
You won't be able to test a normal "resume from background" when changing language because changing the language restarts springboard and therefore your app is killed.
If you maintain UI state manually (as used to be required before multitasking) then you can restore it on the next launch of your app and maintain an illusion of multitasking.