Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>can you give more info? This can be anything, but most likely, rows is pointing to memory where a valid array used to be. How did you create the rows array?</p> <p>For example, your rows array or dictionary not longer pointing to valid memory if you created the rows array as an autoreleased object through a factory method in another method.</p> <p>Here's another question that's pretty close to what you're describing:</p> <p><a href="https://stackoverflow.com/questions/327082/excbadaccess-signal-received">EXC_BAD_ACCESS signal received</a></p> <p>EDIT:</p> <p>So looking at the code you provided, with these lines there are some possibilities:</p> <pre><code>NSDictionary * dict = [[CJSONDeserializer deserializer] deserializeAsDictionary:jsonData error:&amp;error]; if (dict) { rows = [dict objectForKey:@"users"]; } </code></pre> <p>the deserializeAsDictionary method can return either an autoreleased dictionary or NULL. so one possibility is that rows = NULL. when you try [rows count], your program will crash. Check and see what's in error, might give you some clues.</p> <p>This will cause an error even when you explicitly return 2 for <code>numberOfRowsInSection:</code> because in <code>cellForRowAtIndexPath:</code>, you're still trying to access rows, even if it could possibly be NULL.</p> <p>the other possibility lies in how you've defined rows. I'm guessing it's a property in your class. But where you have <code>rows=[dict objectForKey:@"users"];</code>, rows can point to nothing after the method's finished. Rows will still have the address of where [dict objectForKey:] was, but after the scope of the method, dict may be gone and all the data that comes with it.</p> <pre><code>NSDictionary * dict = [[CJSONDeserializer deserializer] deserializeAsDictionary:jsonData error:&amp;error]; </code></pre> <p>under the KVC guidelines, you should expect dict to autorelease after the end of method.</p> <p>and another possibility is, since i don't know the specifics of the JSON class you're using, is that when you release jsonreturn, you're also dealloc'ing all the data associated with it. So in effect, rows is pointing to nothing.</p> <p>case in point, the error seems to be rooted in how you're setting/retaining/accessing rows.</p> <p>try using the Build->Build&amp;Analyze in xcode. it might give you some more hints. or throw in a bunch of <code>NSLog(@"%d",[rows count]);</code> all over. also try using the debugger. it'll give you a trace of method calls that lead up to [rows count] faulting.</p>
 

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