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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T17:49:19+00:00 2026-05-29T17:49:19+00:00

An initial object is created, inserted into the ManagedObjectContext, and the context is saved.

  • 0

An initial object is created, inserted into the ManagedObjectContext, and the context is saved. This object is then set as a property of the singleton class that manages the CoreData stack.

This original object, when referenced from another class, is of the wrong type (NSCFString). On the other hand, if the object is fetched, then it is the correct class and works fine.

NSArray *pdaSetupRecords = [results fetchedObjects];
//If this is the initial launch of the application, create 
//a PDASetup object and save the context, otherwise set 
//pdaSetup to the fetched instance. 
if ([pdaSetupRecords count] < 1) {
    PDASetup *newPdaSetup = (PDASetup *) [NSEntityDescription insertNewObjectForEntityForName:@"PDASetup" inManagedObjectContext:managedObjectContext];
    [self saveContext];
    pdaSetup = newPdaSetup;
    NSLog(@"SystemUtility - PDASetup object created and saved.");
} else {
    pdaSetup = [pdaSetupRecords objectAtIndex:0];
}

There will be only one PDASetup object as you can see. The problem occurs when when the PDASetup object is created. If I re run the app, and the PDASetup object is fetched, everything is fine.

Any thoughts?

  • 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-29T17:49:20+00:00Added an answer on May 29, 2026 at 5:49 pm

    Do you mean to write:

    pdaSetup = [newPdaSetup retain];
    

    or

    self.pdaSetup = newPdaSetup; //with a retained @property
    

    Is your app crashing telling you the type is a NSCFString? Probably the memory address was overwritten with a string.

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

Sidebar

Related Questions

This is my current flow of JQuery: Object is created. Object has a function
I have an initial table view that I created as the initial menu within
I have a .net application (c#) that goes something like this public partial class
Constructors initialize the data members of a class when an object is created. My
I've created a WebAPI that returns JSON. The initial data is as follow (UTF-8
I want to be able to pass one object to another, then set up
I've created a class with properties that have default values. At some point in
Initial tests indicate that GDI+ (writing in VB.NET) is not fast enough for my
How do I assign initial values to fields inside a ModelForm? eg: class Form1(forms.Form):
We're in the initial stages of a large project, and have decided that some

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.