Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The problem stems from this code:</p> <pre><code>seminareArray = [[NSMutableArray alloc] init]; // owned seminareArray = [NSMutableArray arrayWithCapacity:10]; // autoreleased </code></pre> <p>You're first initializing the semiareArray as an owned object, but then are re-setting it as an autoreleased object.</p> <p>Meaning, it will be released after the run-loop terminates. Remove the second (autoreleased) statement but keep the first, and everything should work fine.</p> <p>The reason why you're getting the <code>EXC_BAD_ACCESS</code> error is because the seminareArray object is released at some point before it being used again.</p> <p>Additionally, try to debug your </p> <pre><code>cell.textLabel.text = [seminareArray objectAtIndex:row]; </code></pre> <p>Try setting it as <code>id var = [seminareArray objectAtIndex:row];</code> and then setting <code>cell.textLabel.text = var;</code> This will tell you if the error occurs due to array being dealloc'd too early, or improper cell/textLabel.</p> <hr> <p>Updated:</p> <p><strong>There's an additional problem is with the code:</strong></p> <pre><code>NSString *seminarName = [NSString stringWithFormat:@"%@", [attributeDict objectForKey:@"name"]]; [seminareArray addObject:seminarName]; [seminarName release]; // &lt;-- </code></pre> <p>You're creating an auto-released object seminarName, which technically has retain count 0. You're adding it to the semiareArray, which ups the object retain count to 1. Then you're releasing it again. Which causes it to be dealloc'd at runtime. The problem is that when you're assigning the value to the textLabel, the object no longer exists.</p> <p><strong>Solution</strong>: remove the <code>[seminarName release];</code> Don't worry about releasing the seminarName, since it's auto-released, it will be released when the array is dealloc'd, or when the object it removed from the array.</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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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