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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:11:43+00:00 2026-05-18T02:11:43+00:00

Background I’m using the rather excellent mogenerator to auto generate my core data accessors.

  • 0

Background

I’m using the rather excellent mogenerator to auto generate my core data accessors.

mogenerator structures the classes as following:

NSManagedObject
    _JGTrainingBase
        JGTrainingBase
            _JGTrainingGroup 
                JGTrainingGroup
  • Classes starting with an underscore are machine generated with core data accessors by mogenerator.

  • Classes without an underscore are human editable ones so you can put custom methods in there and not have it overwritten when you change your data model and rerun mogenerator.

  • The training group entity has to-many relationship called “children”.

  • I’m using the Core Data accessors to modify my relationships.

What I Want

I want to update duration – a transient attribute – before adding a children object.

The Problem

My Code

@implementation JGTrainingGroup
...
-(void)addChildrenObject:(JGTrainingGroup *)value_ {
    [self updateDuration];
    [super addChildrenObject:value_];
}
...
@end

But when I call this method, I get an error message:

[JGTrainingGroup addChildrenObject:]: unrecognized selector sent to instance 0x10667fa30

Generated Code

@interface _JGTrainingBase : NSManagedObject {}
// Method declarations
@end

@interface _JGTrainingBase (CoreDataGeneratedAccessors)
- (void)addChildrenObject:(JGTrainingBase*)value_;
- (void)removeChildrenObject:(JGTrainingBase*)value_;
// Lots more methods
@end

Questions

  1. Why does super not respond to the addChildrenObject: method? Is it something to do with these being added in a category style?

  2. How can I access the Core Data generated method from a subclass?

Note

I realise I can add the children object to the set using primitiveValueForKey: and similar, but that means I’m rewriting the core data accessors, thus wasting my time and probably making my code buggy. I trust Apple’s methods would be better than anything I could write.

Thanks for any input on helping me understand what’s going on here.

  • 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-18T02:11:44+00:00Added an answer on May 18, 2026 at 2:11 am

    If you have two subclasses of NSManagedObject where the parent class implements a dynamic property and its subclass (the grandchild of NSManagedObject) overrides the methods for the property, those overrides cannot call super.

    says ADC

    You can not call super as those accessors are generated on demand by the runtime

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

Sidebar

Related Questions

No related questions found

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.