什么是“__connection_block_invoke_2中的错误:连接中断”在iOS? [英] What is "error in __connection_block_invoke_2: Connection interrupted" in iOS?
问题描述
我尝试在 UITableView
中使用 AFNetworking
制作iOS应用程序。 TableView加载20个数据,如Twitter的时间轴。
I am tried to make iOS Application using AFNetworking
in UITableView
. TableView loads 20 datas like Twitter's timeline.
当它加载超过80个数据时,Xcode显示花费约70MB内存和控制台显示
When it loads over 80 datas, Xcode shows spending about 70MB memory and console shows
"Received memory warning."
和
**"error in __connection_block_invoke_2: Connection interrupted".**
这是什么和如何处理此错误?
What is this and How do I treat this error?
推荐答案
原因:当您加载包含70以上的更多数据时mb会崩溃。
Reason: When you load more data which contains above 70 mb will get crash.
Sol:一次只加载数据(EG :) 40。然后通过从Web服务获取数据,下次加载另一个(EG :) 40。通过每次点击服务获取(EG)40数据&使用拉动刷新概念重新加载tableview。
Sol: Load data (EG:)40 only at a time. Then load another (EG:)40 next time by fetching data from web service. Fetch (EG)40 data by hitting service each time & reload tableview using pull to refresh concept.
- 260 MB内存(iPad 2)
- 总共512 Mb ram的设备上有170-180MB内存( iPhone 4,iPod touch 4g)
- 拥有256 MB RAM(iPad,iPhone 3gs,iPod touch 3g)的设备上有40-80MB内存
- 25 MB设备,只有128MB内存(IPhone 3g,iPhone 2g,iPod touch 1g-2g)
- 260 MB of ram (iPad 2)
- 170-180MB of ram on devices with 512 Mb of ram total (iPhone 4, iPod touch 4g)
- 40-80MB of ram on devices that have 256 MB of ram (iPad, iPhone 3gs, iPod touch 3g)
- 25 MB on device with only 128MB of ram (IPhone 3g, iPhone 2g, iPod touch 1g-2g)
请参阅以下链接了解内存泄漏:
Refer following links to know about memory leakage:
- Max Memory
- Memory limit
这篇关于什么是“__connection_block_invoke_2中的错误:连接中断”在iOS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!