gpt4 book ai didi

显示键盘时转动设备时 iPhone 应用程序崩溃

转载 作者:行者123 更新时间:2023-12-03 21:07:15 26 4
gpt4 key购买 nike

我有一个 iPhone 应用程序,其 Web View 会在某个时刻重定向到论坛。

我注意到当我执行以下步骤时应用程序会崩溃:

1) 浏览论坛 (vBulletin)
2) 打开一个线程并尝试发布消息
3)点击文本区域,键盘就会显示出来4)然后快速输入和/或转动设备

现在我的 iPhone 应用程序崩溃了。注意:崩溃只出现在很长的线程中,所以一定是内存或CPU的问题?

无论如何,我不知道在哪里搜索问题,因为 XCode 4 没有显示任何崩溃日志!其次,当通过 Xcode(在设备上)运行应用程序时,它会崩溃,但不会显示任何错误...崩溃无法通过模拟器重现(当然)。

如何解决这样的问题?

<小时/>

控制台:

May 10 00:23:36 unknown SpringBoard[29] <Warning>: Received memory warning. Level=1
May 10 00:23:36 unknown MobilePhone[582] <Warning>: Received memory warning. Level=1
May 10 00:23:37 unknown configd[25] <Notice>: jetsam: kernel memory event (91), free: 1198, active: 7537, inactive: 3482, purgeable: 0, wired: 17615
May 10 00:23:37 unknown SpringBoard[29] <Warning>: Received memory warning. Level=2
May 10 00:23:37 unknown MobilePhone[582] <Warning>: Received memory warning. Level=2
May 10 00:23:38 unknown configd[25] <Notice>: jetsam: kernel termination snapshot being created
May 10 00:23:38 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.apple.mobilephone[0xa185]) Exited: Killed: 9
May 10 00:23:38 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.skype.skype[0xf18]) Exited: Killed: 9
May 10 00:23:38 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.myCompanygmbh.myTestApp[0x9c47]) Bug: launchd_core_logic.c:3795 (24506):0
May 10 00:23:39 unknown com.apple.debugserver-50[598] <Warning>: 1 [0256/1503]: error: ::read ( 4, 0x2ffb19f0, 1024 ) => -1 err = Bad file descriptor (0x00000009)
May 10 00:23:39 unknown SpringBoard[29] <Warning>: Application 'Phone' exited abnormally with signal 9: Killed: 9
May 10 00:23:39 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.myCompanygmbh.myTestApp[0x9c47]) Bug: launchd_core_logic.c:3794 (24506):3
May 10 00:23:39 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.myCompanygmbh.myTestApp[0x9c47]) Bug: launchd_core_logic.c:3202 (24506):10
May 10 00:23:39 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.myCompanygmbh.myTestApp[0x9c47]) Working around 5020256. Assuming the job crashed.
May 10 00:23:39 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:com.myCompanygmbh.myTestApp[0x9c47]) Job appears to have crashed: Segmentation fault: 11
May 10 00:23:39 unknown SpringBoard[29] <Warning>: Application 'Skype' exited abnormally with signal 9: Killed: 9
May 10 00:23:39 unknown SpringBoard[29] <Warning>: Application 'myTestApp' exited abnormally with signal 11: Segmentation fault: 11
May 10 00:23:40 unknown kernel[0] <Debug>: launchd[606] Builtin profile: container (sandbox)
May 10 00:23:40 unknown kernel[0] <Debug>: launchd[606] Container: /private/var/mobile/Applications/1D182D9C-6475-4B81-B409-E6245C60FE84 [69] (sandbox)
May 10 00:23:40 unknown ReportCrash[604] <Error>: Saved crashreport to /Library/Logs/CrashReporter/LowMemory-2011-05-10-002340.plist using uid: 0 gid: 0, synthetic_euid: 0 egid: 0
May 10 00:23:41 unknown Skype[606] <Warning>: ===== Starting HellKit (10021/3.0.0.250/IPHONE) =====
May 10 00:23:41 unknown Skype[606] <Warning>: Running on iOS device model iPhone3,1 (sysctlbyname('hw.machine'))
May 10 00:23:41 unknown Skype[606] <Warning>: Video capture constraints: 12 FPS, complexity mode 8
May 10 00:23:42 unknown MobilePhone[605] <Warning>: UI Mode is Phone
May 10 00:23:43 unknown SpringBoard[29] <Debug>: spd:___libspd_initialize_notify_block_invoke_1:214 spd woke up!
May 10 00:23:43 unknown SpringBoard[29] <Debug>: spd:_libspd_initialize_protocol:142 Registered notification port with spd [PID=609]
May 10 00:23:43 unknown SpringBoard[29] <Debug>: spd:spd_notification_socket_activity:279 Calling session client's callback on their queue for client [PID=606]
May 10 00:23:44 unknown sandboxd[610] <Notice>: Skype(606) deny file-write-create /Applications/.dat025e.000
May 10 00:23:44 unknown mediaserverd[19] <Warning>: 00:23:44.479 <SystemSoundServer> WARNING translating CMSession error: -12985
May 10 00:23:44 unknown mediaserverd[19] <Warning>: 00:23:44.530 <SystemSoundServer> WARNING translating CMSession error: -12985
May 10 00:23:44 unknown spd[609] <Error>: spd:spd_vet_socket:658 getpeername failure for client socket [FD=5]: Socket is not connected
May 10 00:23:44 unknown spd[609] <Error>: spd:spd_checkin_socket:954 Unable to check-in unsupported socket for client [PID=606]
May 10 00:23:44 unknown mediaserverd[19] <Error>: 00:23:44.585 <AudioQueueServer> AudioQueue: Error -12985 from AudioSessionSetClientPlayState(606)
May 10 00:23:45 unknown spd[609] <Error>: spd:spd_vet_socket:658 getpeername failure for client socket [FD=6]: Socket is not connected
May 10 00:23:45 unknown spd[609] <Error>: spd:spd_checkin_socket:954 Unable to check-in unsupported socket for client [PID=606]

最佳答案

我曾经遇到过类似的问题,这里有一个可能的解决方案......

首先,这很可能是内存问题,而不是 CPU 使用率问题,因此请确保在您的应用上实现 - (void)applicationDidReceiveMemoryWarning:(UIApplication *)application 委托(delegate)方法委托(delegate)...在那里放一条日志行。

其次,模拟低内存警告(模拟器在硬件菜单中有该选项)

现在观察您的应用程序在从一个线程切换到另一个线程时是否崩溃(我怀疑它会崩溃)。

如果它确实崩溃了,那么在调试器中检查崩溃的 ivars(尤其是那些与 UI 组件相对应并从 xib 加载的组件)。确保它们引用了它们应该引用的内容:当您的应用程序收到低内存警告时,iOS 将自动卸载隐藏 View 的 xib 资源,如果您在代码中的某个位置保留/依赖其中任何一个,则很可能如果这些 ivars 不是您的代码所期望的,应用程序将会崩溃。

最后的建议:下次发生崩溃时,请确保包含堆栈跟踪。如果您没有在 Debug模式下运行应用程序,您仍然可以使用“iPhone 配置实用程序”获取堆栈跟踪,该实用程序可以读取设备的控制台输出

关于显示键盘时转动设备时 iPhone 应用程序崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5872662/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com