Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8955619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:35:59+00:00 2026-06-15T14:35:59+00:00

For some reason I am getting the above error when this view loads. The

  • 0

For some reason I am getting the above error when this view loads. The same code worked for populating tableView rows in my previous view, so I have no idea what could be going wrong in this one- it is the exact same code. The app crashes when I transition into this view. It manages to NSLog the categories in self.tableRows before crashing correctly, so storage in tableRows does not seem to be the problem. It is crashing on the line that counts the number of rows (return self.tableRows.count). I have a feeling the error has something to do with not being able to access tableRows, but I am very new to iOS. Thanks for your help! This is a project for a college class I have due soon so any help would be really appreciated.

#import "DivisionsViewController.h"
#import "TeamsViewController.h"

@implementation DivisionsViewController

@synthesize tableRows = _tableRows;
@synthesize currentKey = _currentKey;

NSMutableArray* temp;

#pragma mark - Table view data source

- (void)viewDidLoad
{
    [super viewDidLoad];

    _currentKey = @"default";

    //temporary- trying to populate TableView from JSON

    int i = -1;
    self.tableRows = [NSMutableArray array];
    temp = [[NSMutableArray alloc] init];
    for(NSDictionary *dict in self.divisions){
        NSString *category = [dict objectForKey:@"category"];
        if (self.currentKey != category){
            [self.tableRows addObject:category];
            [temp addObject:[[NSMutableArray alloc] init]];
            self.currentKey = category;
            NSLog(@"table value %@", [self.tableRows lastObject]);
            i++;
        }
        [[temp objectAtIndex:i] addObject:dict];
    }
    for (NSString* category in self.tableRows){
        NSLog(@"category: %@", category);
    }
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{

    return self.tableRows.count;        

}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"DivisionCell" forIndexPath:indexPath];
    cell.textLabel.text = [self.tableRows objectAtIndex:indexPath.row];
    return cell;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T14:36:00+00:00Added an answer on June 15, 2026 at 2:36 pm

    Have you tried to NSLog your tablerows count?
    Try to NSlog it before it returns the numberOfRows.

    self.tableRows.count
    

    You can also try to set an exception breakpoint.
    In xcode choose the “breakpoint navigator” – its the second tab from the right in the tabs.
    (The tabs are where you can see your project in the left most tab)
    When you are in that tab, you can push the + in the left bottom -> Add exception breakpoint. Then it breaks right before it crashes – could be useful!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason I'm getting an error that basically states that it can't find
For some reason i'm getting an unexpected [ in the below line of code.
For some reason I am getting the error No database selected I have no
For some reason in the testEmployee method I am getting weird error messages saying
I'm writing a program in C++ and for some reason I'm getting a segmentation
I have just tried using the NSArchiver but for some reason I am getting
I'm trying to write a Counting sort function but for some reason it's getting
For some reason I am having trouble getting my head around __init__ and __new__
For some reason, I am getting a weird overlapping dropdown menu glitch. It works
I'm getting undefined for some reason when I try to return the html via

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.