错误:设备上运行的 Xcode 中的 CONNECTION INTERRUPTED
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14018824/
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
Error: CONNECTION INTERRUPTED in Xcode running on Device
提问by ManOx
Could someone please explain what this error means?
有人可以解释一下这个错误是什么意思吗?
CONNECTION INTERRUPTED
I'm writing files to storage from a method I'm calling from a block. I also sometimes get this message before the "CONNECTION INTERRUPTED":
我正在通过从块中调用的方法将文件写入存储。我有时也会在“连接中断”之前收到此消息:
__47+[TIUserDictionaryController loadWordKeyPairs:]_block_invoke_0 Received nil NSData for TIRemoteDataUserDict
I call this method (the one that writes) at my app did finish launching method and it works, but for some reason it won't work when called within the block. I've tried not using the block and instead a delegate but I still get this error/crash. This error has been completely inconsistent.
我在我的应用程序中调用此方法(写入的方法)确实完成了启动方法并且它可以工作,但是由于某种原因它在块中调用时不起作用。我试过不使用块而是使用委托,但我仍然遇到此错误/崩溃。这个错误已经完全不一致了。
I've never seen any error like this before, so I don't know what more information to give. If you have questions please let me know.
我以前从未见过这样的错误,所以我不知道要提供更多信息。如果您有任何疑问,请告诉我。
采纳答案by Akshay Shah
I am not sure if this would work. But appDidFinsihLaunching should return as early as possible. Since if the method does not return in a specified timeframe, the watchdog would terminate the application.
我不确定这是否有效。但是 appDidFinsihLaunching 应该尽早返回。因为如果方法没有在指定的时间范围内返回,看门狗将终止应用程序。
So I would suggest to call this method using performSelector:withObject:afterDelay: method with a delay of about 1 sec or whatever suits you.
所以我建议使用 performSelector:withObject:afterDelay: 方法调用这个方法,延迟大约 1 秒或任何适合你的方法。
Let me know if that solves your problem.
如果这能解决您的问题,请告诉我。
回答by ArniDat
I got this 'error' as well, it appeared to be the case that I simply used to much memory on the device before the system could tell me this. I was trying to show many very big images on the screen at start up. I solved it by either removing the some of the images or making their memory consumption smaller.
我也遇到了这个“错误”,在系统告诉我这个之前,我只是在设备上使用了大量内存。我试图在启动时在屏幕上显示许多非常大的图像。我通过删除一些图像或减少它们的内存消耗来解决它。
EDIT: I know it is marked as solved, but I had the same problem, without the answer solving my case, I then figured to write my solution and hope it helps someone, as I know that I would have appreciated this answer.
编辑:我知道它被标记为已解决,但我遇到了同样的问题,没有解决我的案例的答案,然后我想写出我的解决方案并希望它对某人有所帮助,因为我知道我会很感激这个答案。