views:

33

answers:

2

Hi all! 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

2: json converter: json converter

3: url connection: url connection

4: cell of uitableview: cell of uitableview

+1  A: 
  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.

Franci Penov
+2  A: 
  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.

KennyTM