简体   繁体   English

失去与“ iOS 9模拟器”的连接

[英]Lost connection to “iOS 9 simulator”

I have stopped all simulator processes but still getting below error. 我已经停止了所有模拟器进程,但仍然低于错误。

Restore the connection to "iPad 2" and run "APPNAME" again, or if "APPNAME" is still running, you can attach to it by selecting Debug > Attach to Process > APPNAME. 将连接恢复到“ iPad 2”并再次运行“ APPNAME”,或者如果“ APPNAME”仍在运行,则可以通过选择“调试”>“附加到进程”>“ APPNAME”来附加它。

Getting this error in Xcode 7.3.1, which is not consistent. 在Xcode 7.3.1中获得此错误,不一致。

在此处输入图片说明

I have a CollectionView and into that, I want to show images from the document directory. 我有一个CollectionView ,在其中,我想显示文档目录中的图像。 So I am using SDWebImage SDK for that. 所以我SDWebImage使用SDWebImage SDK。 So somehow this happens due to this line. 因此,由于这条线,这会以某种方式发生。

let url:NSURL = NSURL(fileURLWithPath: myPathOfDocumentDirectory)
cell.myImageView.sd_setImageWithURL(url, placeholderImage: UIImage(named: "background"))

Because when I put comment on line for set the image into ImageView via SDWebImage SDK, then app not getting crashed. 因为当我在注释行中通过SDWebImage SDK将图像设置为ImageView ,应用程序不会崩溃。 Otherwise it will crash randomly. 否则它将随机崩溃。 Also it happens in devices too. 它也发生在设备中。 I have test this in many devices. 我已经在许多设备中对此进行了测试。

I have read many answers, but into all that answers, talking about reset the simulator. 我读了很多答案,但在所有答案中,都提到了重置模拟器。 But this happens many times with me. 但这在我身上发生了很多次。 So I want a solution for this. 所以我想要一个解决方案。

So Is there anyway to show images from document directory in CollectionView ..? 那么,有没有要在CollectionView ..中显示文档目录中的图像?

Any help would be appreciated. 任何帮助,将不胜感激。

Yess I got the solution. 是的,我找到了解决方案。 Thanks @mitulmarsonia for quick commenting on my question. 感谢@mitulmarsonia对我的问题进行快速评论。

When loading a bunch of very large images (greater then 2000 or 3000 px) in UIImages, Luckily the images were not supposed to be anywhere near that big and I just needed to resize them. 当在UIImages中加载一堆非常大的图像(大于2000或3000 px)时,幸运的是,这些图像不应该位于那个大图像附近,我只需要调整它们的大小即可。

Please resize of your images before saving them document directory if you want to show them into listings. 如果要将图像显示在清单中,请在保存图像文档目录之前调整图像的大小。

Please refer this question for more details. 请参考此问题以获取更多详细信息。

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

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