简体   繁体   English

失去与“ iPhone”的连接

[英]Lost Connection to “iPhone”

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. 但是当我在模拟器中运行时没有得到这个问题。

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. 如果是由于高内存分配,则可能需要调整图像大小。

In Xcode Menu select Debug => Attach to process => Select iOS Simulator 在Xcode菜单中,选择Debug => Attach to process =>选择iOS Simulator

在此处输入图片说明

IT works for me :) or you can quit xcode and restart again 它对我有用:),或者您可以退出xcode并重新启动

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM