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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:13:01+00:00 2026-05-24T13:13:01+00:00

This is weird. I’ve got a super simple project to learn NSTableView, and it’s

  • 0

This is weird. I’ve got a super simple project to learn NSTableView, and it’s set up in my nib, set as a View-based tableView. I’ve also set the dataSource and delegate to my controller obejct.

When I do this, however, and run, I get an EXC_BAD_ACCESS, with the trace starting in my main function and the rest of the stack is internal to Cocoa (so not my code).

There’s really nothing fancy going on, other than this project is using ARC (it’s a new project, so this was the default).

I also tried using the Analyzer to make sure I wasn’t improperly doing memory managment anywhere and there were no issues with it.

I don’t get the crash if I don’t set the dataSource/delegate, but obviously this is not a very good way to build my app!

Any ideas?

Edit

The delegate and dataSource are both set up in IB. The code is as follows (view-based). It’s important to note, I’m getting crashes whether or not this code is present, and it’s the same crash in either case:

- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView {
    return 5;
}

- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
    NSTextField *cell = [tableView makeViewWithIdentifier:@"MyView" owner:self];

    if (nil == cell) {
        cell = [[NSTextField alloc] initWithFrame:CGRectZero];


        cell.identifier = @"MyView";
    }


    [cell setStringValue:[NSString stringWithFormat:@"Row %d", row + 1]];

    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-05-24T13:13:04+00:00Added an answer on May 24, 2026 at 1:13 pm

    It’s simple!

    I had been (somewhat intentionally) trying to leak a variable (because I was too lazy to make an instance variable…writing quick code here), but of course ARC took care of that leak for me, causing the whole thing to blow up.

    So, I just needed to make a strong property so the object I was trying to have stick around (which object was acting as my tableView’s delegate and dataSource) would not be prematurely released.

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

Sidebar

Related Questions

I've got this weird problem - I'm calling ChangeServiceConfig on a newly installed service
I got this weird error which mentions I should install VSTS 2008 SP1, during
I got this weird error when I wanted to validate my in-memory xml Schema,
I'm having this weird problem. My code is simple: #include <iostream> using namespace std;
So - I have this weird problem. I have a major project, no details
I got this weird error when I was trying to compile matlab to C++
I've got this weird error when i try to generate either the filters or
I've got this weird bug happening. I'm basically just adding a few minutes to
I've got this weird problem with my TinyMCE. I've made a FORM with the
I got this weird problem where System.Action cant be resolved when its not explicitly

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.