了解分析我的申请的结果
我有一些内存问题,从另一篇文章我试图分析我的项目以了解我的错误....这里有一些我不明白我的错误在哪里....
谢谢
1:sqlite 连接: sqlite连接http://grab.by/grabs/2125d36a8ec1fb0af1c813af33af5653.png
2:json转换器: json转换器http://grab.by/grabs/7b22080098c8931d7ef505a1eb7c087e.png
3:url连接: url连接http://grab.by/grabs/848a0942f69c91303347d08c64fb2fbb.png
4:uitableview的cell : uitableview 的单元格 http://grab.by/grabs/3917e88829bb6c956bb30445fc7bec20.png
I have some memory problems, from another post I tried to analyze my project to understand my errors.... here are some things that I don't understand where's my error....
thanks
1: sqlite connection:
sqlite connection http://grab.by/grabs/2125d36a8ec1fb0af1c813af33af5653.png
2: json converter:
json converter http://grab.by/grabs/7b22080098c8931d7ef505a1eb7c087e.png
3: url connection:
url connection http://grab.by/grabs/848a0942f69c91303347d08c64fb2fbb.png
4: cell of uitableview:
cell of uitableview http://grab.by/grabs/3917e88829bb6c956bb30445fc7bec20.png
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如前所述,您将分配给
dbrc
而不使用它。如果您不打算使用错误代码,则可以省略该分配。如果上面的
for
循环没有运行(即正则表达式无法匹配),那么matchOk
将永远不会被初始化,即它包含垃圾。您已经
+alloc
分配了一个NSURLConnection,但从未将结果存储在任何地方,因此对于分析器来说,之后没有机会-release
它。这会导致泄漏。您已经
+alloc
ed 了一个 TickerSessions,但没有-release
ing。实际上,您可以打开“构建结果”窗口来查看触发错误的原因。
http://developer.apple.com/ iphone/library/documentation/DeveloperTools/Conceptual/XcodeProjectManagement/art/analyzer_results_by_step.jpg
As stated you're assigning to
dbrc
without using it. You could just leave out the assignment if you're not going to use the error code.If the
for
loop above is not run (i.e. the regex fails to match), thenmatchOk
will never be initialized, i.e. it contains garbage.You have
+alloc
ed a NSURLConnection but never store the result anywhere, thus to the analyzer there is no chance-release
ing it afterwards. This causes a leak.You have
+alloc
ed a TickerSessions without-release
ing it.Actually you could open the Build Results window to see what triggers the error.
http://developer.apple.com/iphone/library/documentation/DeveloperTools/Conceptual/XcodeProjectManagement/art/analyzer_results_by_step.jpg
您正在向 dbrc 分配值,但您从未使用分配的值。只需摆脱该变量即可。
如果正则表达式不匹配或只有一个匹配项,则 matchOk 的值不确定,因为赋值永远不会被执行。因此,dataUsingEncoding消息的接收者是垃圾。
ReadType 是在赋值期间自动分配的类型,很可能是 NSNumber。你永远不会释放那个对象。
您正在显式分配刻度值,但在退出方法作用域之前并未释放它。
You are assigning values to dbrc, but you are never using the assigned value. just get rid of that variable.
If the regular expression does not match or there's only one match, matchOk has an undetermined value, since the assignment will never be executed. Hence, the receiver for dataUsingEncoding message is garbage.
ReadType is of type that does automatic allocation during the assignment, most probably an NSNumber. You are never releasing that object.
You are explicitly allocating the tick value, but you are not releasing it before exiting the method scope.