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

  • SEARCH
  • Home
  • 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 8332591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:46:02+00:00 2026-06-09T02:46:02+00:00

I’m trying to develop a simple application, which upon clicking a menu item, it

  • 0

I’m trying to develop a simple application, which upon clicking a menu item, it shows a window containing an NSTableView.
The problem is that the app crashes just after NSTableView displaying the data. Full stack trace:

* thread #1: tid = 0x2107, 0x00007fff943bce90 libobjc.A.dylib\`objc_msgSend + 16,
             stop reason = EXC_BAD_ACCESS (code=13, address=0x0)
  frame #0: 0x00007fff943bce90 libobjc.A.dylib`objc_msgSend + 16

Since I’m using ARC, I should exclude any reference counting issue; but maybe I’m creating the controller (needed to create the window) in a bad way, and it’s being free’d erroneously.

This is the code of the AppController that create and shows the window:

- (IBAction)showPreferences:(id)sender {
    if(!preferencesWindow) {
        preferencesWindow = [[[PreferencesWindowController alloc]
                          initWithWindowNibName:@"PreferencesWindow"] window];
    }

    [preferencesWindow makeKeyAndOrderFront:sender];
}

This code in PreferencesWindowController implements the dataSource protocol (needed by the NSTableView).

- (int)numberOfRowsInTableView:(NSTableView *)tabView {
    return 1;
}

- (id)tableView:(NSTableView *)tabView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row {
    NSString *val = [NSString stringWithFormat:@"%@[%d]", [tableColumn identifier], row];
    return val;
}

It’s not causing the crash per se. But if I remove the PreferencesWindowController from NSTableView’s dataSource, it doesn’t crash, so it should be somewhat related.

Where’s the mistake?

EDIT: using the profiler (Instruments) with the zombies preset, I can see there’s an object whose reference counter goes negative:

screenshot of Instruments

but anyway, the stack is outside the code I wrote. I can’t put a breakpoint there, and I can’t see which is the object being released twice (or I should say I don’t know how to)

  • 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-09T02:46:03+00:00Added an answer on June 9, 2026 at 2:46 am

    The line preferencesWindow = [[[PreferencesWindowController alloc] initWithWindowNibName:@"PreferencesWindow"] window] looks suspicious, because while you are referencing the window itself with a strong reference, it looks like you’re letting ARC release the PreferencesWindowController.

    Try storing the PreferencesWindowController object in its own strong variable/property and let me know.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to select an H1 element which is the second-child in its group
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I am doing a simple coin flipping experiment for class that involves flipping a
I would like to run a str_replace or preg_replace which looks for certain words

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.