title: Display files from Documents Directory in UITableView - iOS5 minimum
body: <p>I am trying to setup a UITableView that displays the data from the Documents Directory.</p>
  
  <p>I am a bit lost for code, as I have tried many examples from Google and forums etc.</p>
  
  <p>I am creating my app without Storyboard, so it is all in code.</p>
  
  <p>I have got the UITableView displayed, so the delegates and DataView are set - I just need the content.</p>
  
  <p>I have this code to show you, but it is not showing any data:</p>
  
  <pre><code>- (void)viewDidLoad
    {
      [super viewDidLoad];
  
      _firstViewWithOutNavBar = [[UIView alloc] init];
      _firstViewWithOutNavBar.frame = CGRectMake(self.view.frame.origin.x, 0, self.v  iew.frame.size.width, self.view.frame.size.height);
      _firstViewWithOutNavBar.backgroundColor = [UIColor whiteColor];
      [self.view addSubview:_firstViewWithOutNavBar];
  
      UITableView *tableView = [[UITableView alloc] init];
      tableView.frame = CGRectMake(self.view.frame.origin.x, 0,     self.view.frame.size.width, self.view.frame.size.height);
      tableView.delegate = self;
      tableView.dataSource = self;
      [_firstViewWithOutNavBar addSubview:tableView];
    }
  
  - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
      //alloc and init view with custom init method that accepts NSString* argument
      NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
      NSString *documentsDirectory = [paths objectAtIndex:indexPath.row];
      NSString*pathToPass = [documentsDirectory stringByAppendingPathComponent:
                         [tableView cellForRowAtIndexPath:indexPath].textLabel.text]; //pass this.
  
      NSLog(@"%@", pathToPass);
  
  //_nsarray = [[NSArray alloc] initWithContentsOfFile:pathToPass];
  
  
    }
  
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    {
        return [_nsarray count];
        NSLog(@"%@", _nsarray);
     }
  
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:   (NSIndexPath *)indexPath
     {
       static NSString *CellIdentifier = @"Cell";
  
       UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        if (cell == nil) {
            cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
          }
  
        cell.textLabel.text = [NSString stringWithFormat:@"%@",[_nsarray  objectAtIndex:indexPath.row]];
  
        return cell;
          }
  </code></pre>
  
  <p>Any help would be great.</p>