I have an SQLite database implemented in my xcode project. i want to view all name from database into tableview but getting an error as

> 
> NSRangeException', reason: '\*\*\* -[\_\_NSArrayM objectAtIndex:]: index
>  9223372036854775807 beyond bounds [0 .. 13]'
> 
> 
> 

```html
@interface DisplayViewController ()
@property (nonatomic, strong) DBManager *dbManager;
@property (nonatomic, strong) NSArray *arrPeopleInfo;
  @end

@implementation DisplayViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.mytableview.delegate = self;
    self.mytableview.dataSource = self;

    NSString *docsDir;
    NSArray *dirPaths;

    //Get the directory
    dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    docsDir = dirPaths[0];
     self.dbManager = [[DBManager alloc] initWithDatabaseFilename:@"IApp.db"];    //Build the path to keep the database
   // _databasePath = [[NSString alloc] initWithString:[docsDir stringByAppendingPathComponent:@"IApp.db"]];
   // [self getcount];
    [self loadData];
   // [self getcount];
        // Do any additional setup after loading the view.
}

- (void)loadData {
    // Form the query.
    NSString *query = @"select * from iApp";

    if (self.arrPeopleInfo != nil) {
        self.arrPeopleInfo = nil;
    }
    self.arrPeopleInfo = [[NSArray alloc] initWithArray:[self.dbManager loadDataFromDB:query]];

    [self.mytableview reloadData];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    //#warning Potentially incomplete method implementation.
    // Return the number of sections.
    return  1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.arrPeopleInfo.count;
    // return [arri count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"idCellRecord" forIndexPath:indexPath];

    NSInteger indexOfname = [self.dbManager.arrColumnNames indexOfObject:@"firstname"];
    NSInteger indexOffname = [self.dbManager.arrColumnNames indexOfObject:@"lastname"];

    cell.textLabel.text = [NSString stringWithFormat:@"%@ %@", [[self.arrPeopleInfo objectAtIndex:indexPath.row] objectAtIndex:indexOfname], [[self.arrPeopleInfo objectAtIndex:indexPath.row] objectAtIndex:indexOffname]];

    return cell;

}
```