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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:52:47+00:00 2026-06-12T13:52:47+00:00

I am thinking this is a bug in Core Data but before I file

  • 0

I am thinking this is a bug in Core Data but before I file a bug report, I want to be sure it is not just me being stupid.

I set up an NSOutlineView to access the data of 5 different Core Data entities. Each entity’s data is accessed with a different NSArrayController which is bound to the Entity and its’ ManagedObjectContext. I then have the NSOutlineViewDataSource methods return the correct NSString object depending on which entity was expanded.

NOTE: entities is declared elsewhere as an NSArray with names for the entities.

- (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index
       ofItem:(id)item {

if(nil == item) {
    return [entities objectAtIndex:index];
}
NSInteger entityIdx = [entities indexOfObject:item];
if (entityIdx == NSNotFound) {
    return @"";
}
id returnObject = @"";
switch (entityIdx) {
    case 0: {
        Person *person  = [[peopleArrayController arrangedObjects] objectAtIndex:index];
        returnObject = person.fullName;
        break;
    }
    case 1: {
        Media *media = [[mediaArrayController arrangedObjects] objectAtIndex:index];
        returnObject = media.imageTitle;
        break;
    }
    case 2: {
        Note *note  = [[notesArrayController arrangedObjects] objectAtIndex:index];
        returnObject = note.noteDescription;
        break;
    }
    case 3: {
        Source *source = [[sourcesArrayController arrangedObjects] objectAtIndex:index];
        returnObject = source.title;
        break;
    }
    case 4: {
        Repository *repo = [[repostioriesArrayController arrangedObjects] objectAtIndex:index];
        returnObject = repo.name;
        break;
    }
    default:
        break;
}


return returnObject;

}

The Person entity property fullName and the Media entity property imageTitle are custom accessors.

- (NSString *)fullName {
[self willAccessValueForKey:@"surName"];
[self willAccessValueForKey:@"givenName"];
NSString *firstName = [self valueForKey:@"givenName"];
NSString *lastName = [self valueForKey:@"surName"];
NSString *string = [NSString stringWithFormat:@"%@ %@", (firstName) ? firstName : @"", (lastName) ? lastName : @""];
[self didAccessValueForKey:@"surName"];
[self didAccessValueForKey:@"givenName"];
return string;

}

- (id) imageTitle {
[self willAccessValueForKey:@"path"];
id title = [[self valueForKey:@"path"] lastPathComponent];
[self didAccessValueForKey:@"path"];
return title;

}

The program was crashing when I tried to expand the Person or the Media entities but not when I expanded the other entities. I traced the crash to [NSCell _setContents:][NSObject(NSObject) doesNotRecognizeSelector:]

I changed the Media property being returned to a standard Core Data accessor property @”path” and the program stopped crashing when I expanded the Media entity. So the problem is definitely related to the custom accessor.

FYI – I checked to make sure the entity was set to use the NSManagedObject class.

Can anyone give me a reason for the crash other than a bug?

  • 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-12T13:52:48+00:00Added an answer on June 12, 2026 at 1:52 pm

    I got around this problem by changing the method

    - (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item

    to return the managed object

    case 1: {
            Media *media = [[mediaArrayController arrangedObjects] objectAtIndex:index];
            returnObject = media;
            break;
        }
    

    Then I have the method
    - (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item

    return the String

        if ([item isKindOfClass:[Media  class]]) {
        Media *media = (Media *)item;
        return media.imageTitle;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am not to sure if this is a bug, but it certainly has
My java program keeps thinking that every new file is not a file but
Im thinking this is correct, but probably WAY off. I have a string formatted
I was thinking this question for a while, and ever tried to google but
Maybe I am just over thinking this and need to write some more prototype
Maybe I'm thinking about this the wrong way but here's the idea: Class A
This was just what I was thinking for this solution and I would like
I'm thinking of implementing Report a bug/Suggestions option to my game, however I am
All, I'm wondering if this is a MySQL bug, but since I've seen others
I was about to report a but to Eclipse, but I was thinking to

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.