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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:41:31+00:00 2026-06-04T13:41:31+00:00

I have an NSTableView whose data source is an NSMutableArray. The count of the

  • 0

I have an NSTableView whose data source is an NSMutableArray. The count of the array is returned in the numberOfRowsInTableView: method.

The table is refreshed by make a selection in other components such as an NSPopupButton, which changes the content of the array and performs the reloadData method.

The problem is that sometimes I am getting kind of data being written all over each other. So for example if the count is 4 and then after an action is performed it is 10, the additional 6 records are written below the first 4. It is only after I manually scroll the table up and down that the data (correct data) is displayed.

The console displays a message that

-[NSCFArray objectAtIndex:]: index(-1(or possibly larger)) beyond bounds (1056). 

I understand that the error message seems to point out that it is an array beyond bounds, however how can that be when I am only returning, say [array objectAtIndex: rowIndex] in the

- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex

method?

Also, the count return is returned in the numberOfRowsInTableView is always being correct (I know this since I am logging the count using a timer every few seconds).

Any ideas? Thanks!

Edit 1:
I am returning the data as follows:

pc = [[PrinterClass alloc]init];
pc = [ads_printers_array objectAtIndex:rowIndex];       

            if (aTableColumn == tc_make)    
                return [pc make];

            if (aTableColumn == tc_model)           
                return [pc model];

            if (aTableColumn == tc_driver_name)         
                return [pc ppd];

            if (aTableColumn == tc_rdp_driver)      
            {
                if ([pc decider] == 1)
                    return [pc rdp];

                else return [pc model]; 
            }

The array that I mention above is filled with object of a class that I created called PrintersClass.

To reload the data, it’s just reload data as usual:

[ads_rdp_driver_table reloadData];  

With ads_rdp_driver_table being the tableView name.

The thing is that this problem is coming up at random intervals at not at specific points. That is why I can’t put my finger on it..

  • 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-04T13:41:32+00:00Added an answer on June 4, 2026 at 1:41 pm

    Are you 100% sure you have connected the delegate and datasource ?

    You can also do this in code

    ads_rdp_driver_table.datasource = self;
    ads_rdp_driver_table.delegate = self;
    

    add this is in f.ex. awake from nib.

    You also have to connect the tableview itself to an iboutlet, otherwise you can not call it by name.

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

Sidebar

Related Questions

I have a subclassed nstableview whose data source array may increase, by calling reloadData:
I have an NSTableView that is populating with my data source. My data model
I have a custom NSTableView subclass which is bound to a data source (an
I have an NSTableView, with two columns. Whenever I add data to the table,
I have an NSTableView that contains a few columns that are populated with data.
I have an NSTableView that is done using the typical IB and data bindings.
I have a NSTableView that is displaying an array of objects I have. For
I have an NSTableView that binds via an NSArrayController to an NSMutableArray. What's in
I have an NSTableView in my application with data being drawn in for both
I have an NSTableview which s bound to a NSArrayController. The Table/Arraycontroller contains Core

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.