Note that there are some explanatory texts on larger screens.

plurals
  1. PONSMutableArray gets corrupted
    primarykey
    data
    text
    <p>I'm doing an iPhone application which uses a navigation control to browse through some data. This data is stored in a sqlite database and I have a class which gets it and returns it in a NSMutableArray of NSStrings.</p> <p>The problem is that in the first screen of the navigation everything works prefectly, but in the second screen (another view which is pushed) the same code fails because the NSMutableArray gets corrupted. In the debugger I can see that it is returned correctly, but when it's time to use it the pointers have become corrupted and the application crashes.</p> <p>I have put breakpoints in all my functions, and I can't see anywhere where it can get corrupted. And as the first view, which uses the same exact code, even accesing the same eact tables, works correctly I don't really know where to look.</p> <p>If anyone want to have a look at the code I have uploaded it to my site: <a href="http://sachafuentes.com/iBacus.zip" rel="nofollow noreferrer" title="http://sachafuentes.com/iBacus.zip">http://sachafuentes.com/iBacus.zip</a></p> <p>Thanks in advance.</p> <p>UPDATE:</p> <p>The problem lies in the function where I get the data, which looks like (this is a simplified version with some pseudo-code).</p> <pre><code>-(NSMutableArray *) getPaises { NSMutableArray * paises; paises = [[NSMutableArray alloc] init]; while( get new row ) { NSString *aPais = get the value; [paises addObject:aPais]; [aPais release]; } return paises; } </code></pre> <p>If I comment out [aPais release] everything works, but to me this looks like a memory leak, as the NSString won't be released.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload