title: addObject to NSMutableArray not working for iPhone App
body: <p>There have been a few threads on this topic but none have been able to solve my problem. Essentially I am trying to add a custom object to an NSMutableArray and it doesn't seem to be adding. I don't get any errors but I get a warning saying that my array is an "unused variable" so it looks like it is not getting used. See code below. Any help is appreciated!</p>
  
  <p>Here is the initialization in the app delegate (on run time it says this array is not being used):</p>
  
  <pre><code>NSMutableArray *organArray = [[NSMutableArray alloc] init];
  </code></pre>
  
  <p>Here is my object class organ.m (I am importing the app delegate, the rootviewcontroller and the organ.h file)</p>
  
  <pre><code>Organ *organObj = [[Organ alloc] initWithPrimaryKey:primaryKey];
  organObj.organName = [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectstmt,1)];
  organObj.isDirty = NO;
  
  [appDelegate.organArray addObject: organObj];
  
  [organObj release];
  </code></pre>
  
  <p>I know the organObj.organName is getting the correct values from my sqlite db because I can output them to the console. They just don't seem to be getting added to the array and the fact that it says the array is not being used means something is wrong.</p>
  
  <p>Thanks in advance</p>