title: NSMutableArray with Struct
body: <p>i like to make an array out of an typedef struct i have.</p>
  
  <p>It works fine when i work with a FIXED array size. But just to be open for bigger arrays i guess i have to make it with nsmutable array. But here i dont get it run</p>
  
  <pre><code>    //------------ test STRUCT
   typedef struct 
   {
    int id;
    NSString* picfile;
    NSString* mp3file;
    NSString* orgword;
    NSString* desword;
    NSString* category;
   } cstruct;
  
   //------- Test Fixed Array
   cstruct myArray[100]; 
   myArray[0].orgword = @"00000"; // write data
   myArray[1].orgword = @"11111";
  
   NSLog(@"Wert1: %@",myArray[1].orgword); // read data *works perfect
  
  
  
   //------ Test withNSMutable
   NSMutableArray *array = [NSMutableArray array];
      cstruct data;
      int i;
      for (i = 1;  i &lt;= 5;  i++) {
    data.orgword = @"hallo";
    [array addObject:[NSValue value:&amp;data withObjCType:@encode(struct cstruct)]];
   }
  
   data = [array objectAtIndex:2];  // something is wrong here
   NSLog(@"Wert2: %@",data.orgword); // dont work
  </code></pre>
  
  <p>any short demo that works would be appreciated :) still learning</p>
  
  <p>Thx
  Chris</p>