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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:35:06+00:00 2026-06-05T03:35:06+00:00

In have an NSManagedObject subclass: @interface ManagedActivityAmount : NSManagedObject @property (nonatomic, retain) NSNumber *

  • 0

In have an NSManagedObject subclass:

    @interface ManagedActivityAmount : NSManagedObject

    @property (nonatomic, retain) NSNumber * distance;
    @property (nonatomic, retain) NSNumber * duration;
    @property (nonatomic, retain) NSSet *sets;

    @end

    @interface ManagedActivityAmount (CoreDataGeneratedAccessors)

    - (void)addSetsObject:(ManagedPowerSet *)value;
    - (void)removeSetsObject:(ManagedPowerSet *)value;
    - (void)addSets:(NSSet *)values;
    - (void)removeSets:(NSSet *)values;

    @end

I encounter a problem in keeping a reference to an object that i added to the sets relationship using the:

    - (void)addSetsObject:(ManagedPowerSet *)value;

the ManagedPowerSet object was successfully added to the ManagedActivityAmount sets property, and I’m assuming it’s retain count is 1 due to this (the actual object was autoreleased before that so the retain count was 0 before adding it to the set). am I correct? am I missing something?

I’m assigning the ManagedPowerObject to another instance variable of the view controller (this is a private instance variable, not a retained property) but I can’t seem to access it later. should I retain it? i’m just about to do so and check, but I really want to understand we it wasn’t retained in the first place.

thanks 🙂

  • 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-05T03:35:09+00:00Added an answer on June 5, 2026 at 3:35 am

    So i wasn’t missing anything, the retain count assumptions were correct, no retain was needed since the object outlives the controller, if it were a property it should have been assigned..

    the problem was really stupid on my part, i didn’t allocate something else that made it looked like the object was lost, though actually it wasn’t.

    as for the debugger and what seems as if the two pointers that were supposed to point to the same address but weren’t – i have no clue why this happens, i guess the xcode debugger has some delays..

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

Sidebar

Related Questions

I have a NSManagedObject subclass, created by the XCode model interface. This class has
I have an NSManagedObject subclass MyClass with a property myProp , which is defined
I have an NSArrayController bound to a property of an NSManagedObject subclass. The subclass
I have a ConfiguracaoDaApp class in my project that is a NSManagedObject subclass. I
I have one subclass of NSManagedObject like following and stored some instances by NSManagedObjectContext.
I have a NSManagedObject subclass named Tour. I stored the reference to it using
I have a CoreData NSManagedObject subclass, TextNarration, that has an attribute of type NSString,
In my Objective-C project I have a Country class (NSManagedObject subclass). When comparing a
When I have a subclass of NSManagedObject, I could do this: Friend *newFriend =
I have a CoreData model (managed object) called Item: @interface Item : NSManagedObject {

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.