title: Xcode Objective-C simple array in array
body: <p>Iam new in Objective-C</p>
  
  <p>I have integrated one <code>Array</code> in another <code>Array</code>, it works</p>
  
  <p>My Question: I have often use <code>Row *row  = [[Row alloc] init];</code>, but I think its not right to use too often this code. Please look at my code there you find 3 times the code.</p>
  
  <p>my XMLPARSER.h</p>
  
  <pre><code>@interface XMLParser : NSObject &lt;NSXMLParserDelegate&gt; {
  
      // veränderlicher String
      NSMutableString *currentString;
  
      BOOL storingCharacters;
  
      //unveränderliche Strings
      NSString *user;
      NSString *score;
      NSString *idValue;
      NSString *responseCode;
  
      int index;
  
      //Klasse von NSArray, objekte können hinzugefügt und verändert werden, keine feste Anzahl von Elementen
      NSMutableArray *rows;
  }
  
  @property (nonatomic, retain) NSMutableString *currentString;
  @property (nonatomic, retain) NSString *user;
  @property (nonatomic, retain) NSString *score;
  @property (nonatomic, retain) NSString *idValue;
  @property (nonatomic, retain) NSString *responseCode;
  @property (nonatomic)  BOOL storingCharacters;
  
  @property (nonatomic, retain) NSMutableArray *rows;
  
  - (void)parseXMLFile:(NSString *)pathToFile;
  - (void)print;
  
  @end
  
  
  @interface Row: NSObject{
      NSString *user;
      NSString *score;
      NSMutableArray *ids;
      int index;
  }
  
  @property (nonatomic, retain) NSString *user;
  @property (nonatomic, retain) NSString *score;
  @property (nonatomic, retain) NSMutableArray *ids;
  @property (nonatomic) int index;
  @end
  </code></pre>
  
  <p>my XMLPArser.c</p>
  
  <pre><code>   - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName {
  
  
      if ([elementName isEqualToString:kName_response]) {
  
      }else if ([elementName isEqualToString:kName_responseCode]) {
          self.responseCode=[[NSString alloc] initWithString: currentString];
      }else if ([elementName isEqualToString:kName_rows]) {
  
      }else if ([elementName isEqualToString:kName_row]) {
          Row *row  = [[Row alloc] init];
  
          row.user=self.user;      
          row.score=self.score;
  
          [self.rows insertObject:row atIndex:index];
          index=index+1;
          [row release];
  
  
      }else if ([elementName isEqualToString:kName_user]) {
          self.user=[[NSString alloc] initWithString: currentString];
      }else if ([elementName isEqualToString:kName_score]) {
          self.score=[[NSString alloc] initWithString: currentString];
      }
      else if ([elementName isEqualToString:kName_extra]) {
           Row *row  = [[Row alloc] init];
          NSLog(@"indexwert:%@",row.index);
           row.index = 0;
          [row release];
      }
      else if ([elementName isEqualToString:kName_ids]) {
          self.idValue=[[NSString alloc] initWithString: currentString];
          Row *row  = [[Row alloc] init];
          row.ids = [[NSMutableArray alloc] init];
          [row.ids insertObject:idValue atIndex:row.index];
  
          NSLog(@"The number!!!! %@ in %@ ",idValue, [row.ids objectAtIndex:row.index]); //it works
  
          row.index = row.index+1;
  
         // NSLog(@"hallo %@",idValue); //it works 
          [row.ids release];
          [row release];
  
  
      }
  
      storingCharacters = NO;
  }
  </code></pre>
  
  <p>Is my code right?</p>