开发者

Understanding the results of analyzing my application

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 err开发者_运维知识库or....

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


  1. 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.

    sqlite3_prepare_v2(...);
    ...
    while (sqlite3_step(...) == SQLITE_ROW) {
      ...
    
  2. If the for loop above is not run (i.e. the regex fails to match), then matchOk will never be initialized, i.e. it contains garbage.

    NSString* matchOK = nil;
    int nM = 0;
    ...
    
  3. You have +alloced a NSURLConnection but never store the result anywhere, thus to the analyzer there is no chance -releaseing it afterwards. This causes a leak.

  4. You have +alloced a TickerSessions without -releaseing 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


  1. You are assigning values to dbrc, but you are never using the assigned value. just get rid of that variable.

  2. 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.

  3. ReadType is of type that does automatic allocation during the assignment, most probably an NSNumber. You are never releasing that object.

  4. You are explicitly allocating the tick value, but you are not releasing it before exiting the method scope.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜