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 8884639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:06:34+00:00 2026-06-14T21:06:34+00:00

In my header file: @interface HTMLClassesViewController : UITableViewController <UITableViewDataSource, UITableViewDelegate> So I did declare

  • 0

In my header file:

@interface HTMLClassesViewController : UITableViewController <UITableViewDataSource, UITableViewDelegate>

So I did declare the dataSource and delegate.

In my implementation file:

- (void)viewDidLoad {

    [super viewDidLoad];

    if (self.arrayOfClasses == nil) {
        self.arrayOfClasses = [[NSMutableArray alloc] init];
    }
    NSMutableArray *array = [[NSMutableArray alloc] init];
    ... // Gather data from HTML source and parse it into "array"
    self.arrayOfClasses = array; //arrayOfClasses here is non-nil (with correct objects)
    NSLog(@"%@ test1", [self.arrayOfClasses objectAtIndex:0]);
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    NSLog(@"%@ test1.5", [self.arrayOfClasses objectAtIndex:0]);
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
NSLog(@"%@ test2", [self.arrayOfClasses objectAtIndex:0]);
    return [self.arrayOfClasses count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"%@ test3", [self.arrayOfClasses objectAtIndex:0]);
    static NSString *CellIdentifier = @"WebCollegeCell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }
    cell.textLabel.text = [self.arrayOfClasses objectAtIndex:indexPath.row];
    return cell;
}

And this is the output from NSLog:

2012-11-24 22:52:19.125 ArizonaCollegeSearch[72404:c07] CSE 240 test1
2012-11-24 22:52:19.126 ArizonaCollegeSearch[72404:c07] CSE 240 test1.5
2012-11-24 22:52:19.127 ArizonaCollegeSearch[72404:c07] (null) test1.5
2012-11-24 22:52:19.127 ArizonaCollegeSearch[72404:c07] (null) test2

As you can see, numberOfSectionsInTableView is being called with an non-null object, and then with a null object, and numberOfRowsInSection is being called with a null object, and cellForRowAtIndexPath is not being called at all. I don’t even have a [self.tableView reloadData] anywhere.

Any suggestions?

  • 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-14T21:06:35+00:00Added an answer on June 14, 2026 at 9:06 pm

    So the property holding your array needs to be declared strong, else it will get deallocated when the variable it has been assigned to is deallocated. And in the case of a local variable (your NSMutableArray *array), that’s the end of its scope, e.g. when the function viewDidLoad returns.

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

Sidebar

Related Questions

This is the original header file: @interface TestDataHelper : NSObject { } +(void) populateTestData:(NSManagedObjectContext*)
header file: private: vector<int*>* nums; public slots: void buttonClicked(); cpp file: NewWindow(){ int one
Here's the header file: @interface calc : NSObject { IBOutlet NSTextField *tf1; IBOutlet NSTextField
I have a variable declared in the header file : @interface int _nPerfectSlides; and
Here is my header file #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> #import <PolygonShape.h> @interface Controller :
My header file: @interface MapViewController : UIViewController <MKMapViewDelegate, NSFetchedResultsControllerDelegate> { MKMapView *mapView; NSFetchedResultsController *fetchedResultsController;
When I go look at NSArray's interface file, it doesn't declare any instance variable.
I can understand defining the functions in the @interface of the header file, but
UPDATE:: OK so I have these new lines in the header file: static void
Common examples for a ObjC object are like this (for the header file): @interface

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.