title: Trouble in UITableView
body: <p>I have a <code>UITableView</code> which uses <code>NSMutableArray</code> populated by parsing an xml file.</p>
  
  <p><strong>Problem:</strong> The data gets added to the array but is not visible in the <code>UITableView</code>.</p>
  
  <p><strong>Sublist.h</strong></p>
  
  <pre><code>@interface SubList:UIViewController &lt;UITableViewDelegate, UITableViewDataSource&gt;
  {
      IBOutlet UITableView *List1;
      NSXMLParser *xmlparser;
      NSURLConnection *conn;
      NSMutableData *webdata;
      NSString *FolderID;
      NSMutableArray *info;
      NSMutableArray *SubFolderData;
  }
  
  @property(nonatomic,retain) NSMutableArray *info;
  @property(nonatomic,retain) NSMutableArray *SubFolderData;
  @property (nonatomic,retain)NSString *FolderID;
  @property(nonatomic,weak)IBOutlet UITableView *List1;
  @property (nonatomic,retain) NSString *theXML;
  </code></pre>
  
  <p>@end</p>
  
  <p><strong>Sublist.m</strong></p>
  
  <pre><code>@implementation SubList
  
  - (void)viewDidLoad 
  {
      self.navigationController.navigationBar.hidden=YES; 
      [super viewDidLoad];
      [self initWithData];
      [self GetChilds:FolderID UserID:@"1"];
  }
  
  -(void)GetChilds:(NSString*)FolderIDRecvd UserID:(NSString*)userID
  {
      FolderID=[NSString stringWithFormat:@"%@", FolderIDRecvd];
      NSString *_UserID=@"1";
  
      NSString *soapMsg=[NSString stringWithFormat:@"&lt;?xml version='1.0' encoding='utf-8'?&gt;    &lt;soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'   xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'&gt;&lt;soap:Body&gt;&lt;TreeDataSubFolder xmlns='http://tempuri.org/'&gt;&lt;FolderID&gt;%@&lt;/FolderID&gt;&lt;UserId&gt;%@&lt;/UserId&gt;&lt;/TreeDataSubFolder&gt;&lt;/soap:Body&gt;&lt;/soap:Envelope&gt;",FolderID,_UserID];
  
  
      NSURL *url=[NSURL URLWithString:@"http://192.168.1.5/interlogicsmobile/interlogics.asmx?op=TreeDataSubFolder"];
      xmlparser = [[NSXMLParser alloc] initWithContentsOfURL:url];
      NSMutableURLRequest *req=[NSMutableURLRequest requestWithURL:url];
      NSString *msgLength=[NSString stringWithFormat:@"%d",[soapMsg length]];
  
      [req addValue:@"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
      [req addValue:@"http://tempuri.org/TreeDataSubFolder" forHTTPHeaderField:@"SOAPAction"];
      [req addValue:@"length" forHTTPHeaderField:@"Content-Length"];
      [req setHTTPMethod:@"POST"];
      [req setHTTPBody: [soapMsg dataUsingEncoding:NSUTF8StringEncoding]];
  
      conn=[[NSURLConnection alloc]initWithRequest:req delegate:self];
  
      if(conn) {
          webdata=[[NSMutableData data] retain];
      }
  }
  
  -(void) connection:(NSURLConnection *) connection didReceiveResponse:(NSURLResponse *)   response 
  {
      NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response; 
      int responseStausCode = [httpResponse statusCode]; 
      [webdata setLength: 0]; 
  }
  
  -(void) connection:(NSURLConnection *) connection didReceiveData:(NSData *) data 
  {
      [webdata appendData:data];
  }
  
  -(void) connection:(NSURLConnection *) connection didFailWithError:(NSError *) error 
  {
      [webdata release];
      [connection release];
  }
  
  -(void) connectionDidFinishLoading:(NSURLConnection *) connection 
  {
      theXML= [[NSString alloc] 
            initWithBytes: [webdata mutableBytes] 
            length:[webdata length] 
            encoding:NSUTF8StringEncoding];
  
      [theXML release];
  
      SubListParser *parserObjForData1=[[SubListParser alloc]init];
      SubFolderData=[[[NSMutableArray alloc]init]retain];
      SubFolderData=[parserObjForData1 UserXMLParser1:webdata];
  
      [connection release];
      [webdata release];
      [List1 reloadData];
  }
  
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  {
      return([SubFolderData count]/2);
  }
  
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      int row = [indexPath row]*2;
      static  NSString *cellIdentifier=@"cell";
      UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellIdentifier];
      if(cell==nil)
      {
          cell=[[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault   reuseIdentifier:@"cell"] autorelease];
          cell.textLabel.text = [SubFolderData objectAtIndex:row+1];
          cell.detailTextLabel.text = [SubFolderData objectAtIndex:row];
      }
  
         for (int i=0; i&lt;=[SubFolderData count]; i++) {
  
          NSString *filename = [SubFolderData objectAtIndex:indexPath.row];
          NSString *ext = [filename pathExtension];
          if ([ext isEqualToString:@"doc"] || [ext isEqualToString:@"DOC"]) {
              [cell.imageView setImage:[UIImage imageNamed:@"DOC.png"]];
          } else if ([ext isEqualToString:@"jpg"]|| [ext isEqualToString:@"JPG"]) {
              [cell.imageView setImage:[UIImage imageNamed:@"JPG.png"]];
          }else if([ext isEqualToString:@"pdf"]|| [ext isEqualToString:@"PDF"]){
              [cell.imageView setImage:[UIImage imageNamed:@"PDF.png"]];
          }else if([ext isEqualToString:@""]){
              [cell.imageView setImage:[UIImage imageNamed:@"Folder2.png"]];
          }else if([ext isEqualToString:@"docx"]|| [ext isEqualToString:@"DOCX"]){
              [cell.imageView setImage:[UIImage imageNamed:@"DOCX.png"]];
          }else if([ext isEqualToString:@"TIF"]|| [ext isEqualToString:@"tif"]){
              [cell.imageView setImage:[UIImage imageNamed:@"TIFF.png"]];
          }else if([ext isEqualToString:@"png"]|| [ext isEqualToString:@"PNG"]){
              [cell.imageView setImage:[UIImage imageNamed:@"PNG.png"]];
          }else if([ext isEqualToString:@"gif"]|| [ext isEqualToString:@"GIF"]){
              [cell.imageView setImage:[UIImage imageNamed:@"GIF.png"]];
          }else if([ext isEqualToString:@"jpeg"]|| [ext isEqualToString:@"JPEG"]){
              [cell.imageView setImage:[UIImage imageNamed:@"JPG.png"]];
          }
      }
  
      return cell;
  }
  
  @end
  </code></pre>
  
  <h2>EDIT</h2>
  
  <pre><code>-(NSMutableArray *)UserXMLParser1:(NSData *)WebDataRecieved1
  {
      NSXMLParser *xmlparser1=[[NSXMLParser alloc]initWithData:WebDataRecieved1];
      [xmlparser1 setDelegate:self];
      BOOL success=[xmlparser1 parse];
      NSLog(@"%i",success); return listset1;
  }
  </code></pre>