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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:56:41+00:00 2026-06-13T20:56:41+00:00

I’m setting up a view-based NSTableView, however the method numberOfRowsInTableView is not being called.

  • 0

I’m setting up a view-based NSTableView, however the method numberOfRowsInTableView is not being called. When I check whether it is being called, the log returns nil.

I have set up my AppDelegate to conform to the datasource and the delegate protocols and have connected these through IB to the AppDelegate. My array that will feed the table is initialised when app finishes loading.

My code is as follows:

Interface

#import <Cocoa/Cocoa.h>

@interface RLTAppDelegate : NSObject <NSApplicationDelegate, NSTableViewDataSource, NSTableViewDelegate>

@property (assign) IBOutlet NSWindow *window;
@property (weak) IBOutlet NSTableView *tableView;
@property (copy) NSArray *nameArray;

@end

Implementation

#import "RLTAppDelegate.h"

@implementation RLTAppDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
  self.nameArray = [[NSArray alloc] initWithObjects:@"Ryan", nil];
}

- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView {

  return [self.nameArray count];
  NSLog(@"%lu", self.nameArray.count);
}

- (NSView *)tableView:(NSTableView *)tableView
   viewForTableColumn:(NSTableColumn *)tableColumn
              row:(NSInteger)row {

NSTextField *result = [tableView makeViewWithIdentifier:@"name" owner:self];
result.stringValue = [self.nameArray objectAtIndex:row];
return result;
}

@end
  • 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-13T20:56:42+00:00Added an answer on June 13, 2026 at 8:56 pm

    I just made a test project to see what is going on.

    If you put a breakpoint on applicationDidFinishLaunching and also on numberOfRowsInTableView you’ll see that the numberOfRowsInTableView method is called before the applicationDidFinishLaunching notification is received.

    So you’re asking for the array before it has been populated.

    Normally, you’d have a separate class where this happens and you set up the array when that class in initialised, so this doesn’t happen.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
I have a small JavaScript validation script that validates inputs based on Regex. I
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I need a function that will clean a strings' special characters. I do NOT
I have a view passing on information from a database: def serve_article(request, id): served_article
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all

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.