xcode 与“iPhone”的连接丢失
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/37250978/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Lost Connection to "iPhone"
提问by Chandan Reddy
When i am trying to run application in the real device getting this error
当我尝试在真实设备中运行应用程序时出现此错误
Restore the connection to “iPhone” and run “My App” again, or if “My App” is still running, you can attach to it by selecting Debug > Attach to Process > My App.
恢复与“iPhone”的连接并再次运行“我的应用程序”,或者如果“我的应用程序”仍在运行,您可以通过选择“调试”>“附加到进程”>“我的应用程序”来附加到它。
Actually getting this problem when loading bunch of images(nearly 35) into CollectionView from web service.
实际上在从 Web 服务将一堆图像(近 35 个)加载到 CollectionView 时遇到了这个问题。
But not getting this problem when i am running in simulator.
但是当我在模拟器中运行时没有遇到这个问题。
采纳答案by Penkey Suresh
This could be a memory issue if you have images of very high resolution. Check the memory usage of the device in Xcode Debug Navigator
.
如果您有非常高分辨率的图像,这可能是内存问题。在 Xcode 中检查设备的内存使用情况Debug Navigator
。
To debug if it is because of images
调试是否是因为图像
- Try using no images or disable image loading in the code and check if the problem still persists
- 尝试在代码中不使用图像或禁用图像加载并检查问题是否仍然存在
If it is because of high memory allocation you might have to resize the images.
如果是因为内存分配过高,您可能需要调整图像大小。