xcode 奇怪的新 iOS 7 错误:来自 DB / ForceShrinkPersistentStore_NoLock 的接收器
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19140151/
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
Strange new iOS 7 errors: receiver from DB / ForceShrinkPersistentStore_NoLock
提问by avuthless
Good day.
再会。
I have a project that uses a lot of network connections with SSL. This project runs fine and without errors on iOS 5 and 6. But with new iOS 7 i keep getting these two errors:
我有一个使用 SSL 的大量网络连接的项目。这个项目在 iOS 5 和 6 上运行良好并且没有错误。但是对于新的 iOS 7,我不断收到这两个错误:
ERROR: unable to get the receiver data from the DB
ForceShrinkPersistentStore_NoLock -delete- We do not have a BLOB or TEXT column type. Instead, we have 5.
They are not connected in any way and i did keep getting first one for few weeks, then later i got this second one too.
它们没有以任何方式连接,我确实在几周内一直得到第一个,然后我也得到了第二个。
They are received on my application start, at that point i send few HTTP POST's and process received data. I cannot catch where do these errors come from.
它们在我的应用程序启动时收到,那时我发送了一些 HTTP POST 并处理接收到的数据。我不知道这些错误来自哪里。
I could find them if i could understand them. Anyone know what do they mean or on what cases one can cause them?
如果我能理解它们,我就能找到它们。任何人都知道它们是什么意思或在什么情况下会导致它们?
采纳答案by gmorph
I also had the first of your problems just today:
我今天也遇到了你的第一个问题:
ERROR: unable to get the receiver data from the DB
I don't know the reason (maybe somehow the cache got corrupt) but deleting all of the simulator's Applications folder made the problem go away for me.
我不知道原因(也许缓存以某种方式损坏了)但是删除模拟器的所有应用程序文件夹使我的问题消失了。
rm -rf ~/Library/Application Support/iPhone Simulator/7.0-64/Applications/*
回答by Perisheroy
I got the same problem, but is is while debugging on a iOS device (iPhone 4 iOS 7.0.4)
我遇到了同样的问题,但是是在 iOS 设备上调试时 (iPhone 4 iOS 7.0.4)
Not sure what causes this... But I tried deleting the app on device and rerunning, then the error is gone.
不知道是什么原因造成的......但我尝试删除设备上的应用程序并重新运行,然后错误消失了。
回答by Jayprakash Dubey
This error generally occurs in iOS7 and reason might be cache issues. I fixed the problem by deleting folder of simulator.
此错误通常发生在 iOS7 中,原因可能是缓存问题。我通过删除模拟器文件夹解决了这个问题。
Steps :
脚步 :
Right click on “Finder”window select “Go to Folder”
右键单击“Finder”窗口选择“转到文件夹”
Paste “~/Library/Application Support/iPhone Simulator/”
粘贴“~/Library/Application Support/iPhone Simulator/”
This will open iPhone Simulator folder containing simulators used in execution.
这将打开 iPhone Simulator 文件夹,其中包含执行中使用的模拟器。
Now, delete 7.x folder.
现在,删除 7.x 文件夹。
回答by Delorean
Got same problem today. In my case ERROR: unable to get the receiver data from the DB
error message was not resolved by cleaning app from simulator/device. Once running app for a while error got reported again. Also it was logged each time I did [NSURLSession dataTaskWithRequest:...]
calls.
今天遇到同样的问题。在我的情况下,ERROR: unable to get the receiver data from the DB
错误消息没有通过从模拟器/设备清除应用程序来解决。一旦运行应用程序一段时间错误再次报告。每次我[NSURLSession dataTaskWithRequest:...]
打电话时都会记录下来。
Found it was related to caching responses. Setting policy to ignore local cache eliminated error logging:
发现它与缓存响应有关。设置忽略本地缓存的策略消除了错误记录:
NSURLSessionConfiguration *defaultConfigObject = [NSURLSessionConfiguration defaultSessionConfiguration];
defaultConfigObject.requestCachePolicy = NSURLRequestReloadIgnoringLocalCacheData;
NSURLSession *session = [NSURLSession sessionWithConfiguration: defaultConfigObject
delegate: nil
delegateQueue: [NSOperationQueue mainQueue]];
NSURLSessionDataTask * dataTask = [session dataTaskWithRequest:urlRequest completionHandler:completion];
[dataTask resume];
Note: Session has to be invalidated once not needed any more, otherwise will cause memory leak
注意:Session一旦不再需要就必须失效,否则会造成内存泄漏
回答by iCodeAtApple
I too faced a similar problem..
我也遇到了类似的问题。。
Including the above suggestion I also ignored the cache in my post request
包括上述建议,我也忽略了发布请求中的缓存
NSURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:60.0];
and the problem never appeared for me...
而这个问题从来没有出现在我身上......
回答by GrandSteph
It was easier to fix for me:
对我来说更容易修复:
Just Deleted the app from the simulator (like you would from you phone - no need for me to delete some folders) fixed the issue.
刚刚从模拟器中删除了应用程序(就像你从手机中删除的一样 - 我不需要删除一些文件夹)解决了这个问题。
回答by LpLrich
Deleting derived data solved this for me.
删除派生数据为我解决了这个问题。
Window > Organiser > Projects
窗口 > 管理器 > 项目
Select your project, hit delete beside derived data.
选择您的项目,点击派生数据旁边的删除。