title: NSMutableArray won't fill up
body: <p>I am trying to fill up an NSmutableAray with data from sqlite database.</p>
  
  <p>ItemShow class:</p>
  
  <pre><code>@interface ItemShow : NSObject 
  {
  NSInteger itemID;
  NSString *itemYear;
  NSInteger rarity;
  NSString *mintage;
  NSInteger availability;
  NSInteger quality;
  NSString *mintMark;
  NSString *masterMark;
  NSString *dateCode;
  NSString *dateDescription;
  }
  </code></pre>
  
  <p>Getters/setters are ok</p>
  
  <p>Method in DBAccess class:</p>
  
  <pre><code>-(NSMutableArray*)getItemsOverView:(int)itemID
  {
  NSMutableArray *itemsArray=[[[NSMutableArray alloc]init]autorelease];
  const char *sqlItems=sqlite3_mprintf("SELECT itm.itemID,itm.itemYear,itm.rarity,itm.mintage,iaval.availability as avalibility,iaval.quality as quality,itm.Mintmark,itm.masterMark,dc.dateCode,dc.dateDescription\
                                       from items as itm\
                                       join itemAvailability as iaval on iaval.itemID=itm.itemID\
                                       join dateCultures as dc ON dc.dateCultureID=itm.dateCulture\
                                       WHERE itm.itemID=%i",itemID);
  sqlite3_stmt *statement;
  int sqlResult = sqlite3_prepare_v2(database, sqlItems, -1, &amp;statement, NULL);
  if ( sqlResult== SQLITE_OK)
  {
      while (sqlite3_step(statement) == SQLITE_ROW)
      {
          ItemShow *itemShow=[[ItemShow alloc]init];
          itemShow.itemID=sqlite3_column_int(statement, 0);
          char *itemYear=(char *)sqlite3_column_text(statement, 1);
          itemShow.rarity=sqlite3_column_int(statement, 2);
          char *mintage=(char *)sqlite3_column_text(statement, 3);
          itemShow.availability=sqlite3_column_int(statement, 4);
          itemShow.quality=sqlite3_column_int(statement, 5);
          char *mintMark=(char *)sqlite3_column_text(statement, 6);
          char *masterMark=(char *)sqlite3_column_text(statement, 7);
          char *dateCode=(char *)sqlite3_column_text(statement, 8);
          char *dateDescription=(char *)sqlite3_column_text(statement, 9);
  
          itemShow.itemYear=(itemYear)?[NSString stringWithUTF8String:itemYear]:@"";
          itemShow.mintMark=(mintMark)?[NSString stringWithUTF8String:mintMark]:@"";
          itemShow.masterMark=(masterMark)?[NSString stringWithUTF8String:masterMark]:@"";
          itemShow.mintage=(mintage)?[NSString stringWithUTF8String:mintage]:@"Unknown";
          itemShow.dateCode=(dateCode)?[NSString stringWithUTF8String:dateCode]:@"";
          itemShow.dateCode=(dateDescription)?[NSString stringWithUTF8String:dateDescription]:@"";
  
          [itemsArray addObject:itemShow];
          [itemShow release];
  
      }
      sqlite3_finalize(statement);
  }
  else
  {
      [self dbConnectionError];
  }
  
  return itemsArray;
  }
  </code></pre>
  
  <p>code in ViewDidLoad</p>
  
  <pre><code>DBAccess *dbAccess=[[DBAccess alloc]init];
  self.dataArr=[dbAccess getItemsOverView:itemID];
     // ItemShow *itmShow=[dataArr objectAtIndex:1];
  NSLog(@"%d",[dataArr count]); //returns 1. So, empty array
  [dbAccess closeDataBase];
  [dbAccess release];
  </code></pre>
  
  <p>Same construction works fine in other views, but now it gives error - empty array out of bounds.</p>
  
  <p>What was checked</p>
  
  <ol>
  <li>Select works. checked it in SQLiteStudio</li>
  <li>itemID is int and the view getting it correct from previous view like it gets title.</li>
  </ol>