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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:45:49+00:00 2026-05-24T05:45:49+00:00

I’m currently trying to set up my entity by filling in the required attributes.

  • 0

I’m currently trying to set up my entity by filling in the required attributes. I am doing this by parsing an XML response and assigning the attributes as they come up. The issue that I am running into is that I have what seems to be a type mismatch that results in my attribute set function throwing an “incorrect selector sent to function” error. I have gone into the debugger and noticed that always before assigning to my custEntity.name attribute, my type seems to be of NSCFString instead of NSString. I have done some searching as well as some tests and attempted fixes of my own but have been unable to get anywhere. Here is some relevant code and its effects.

Auto Generated and Combined into one file with my other entity definition, DataModelObject.h:

@interface Checkpoint : NSManagedObject {
    @private
}
@property (nonatomic, retain) NSString * name;
@property (nonatomic, retain) NSNumber * lat;
@property (nonatomic, retain) NSNumber * lon;
@property (nonatomic, retain) NSManagedObject * myRoute;
@end

DataModelObject.m

@implementation Checkpoint
@dynamic name;
@dynamic lat;
@dynamic lon;
@dynamic myRoute;
@end

What my current code looks like as a result of a suggestion to someone else with a somewhat similar problem elsewhere:

NSString *chkptName = [attributeDict objectForKey:@"name"];
checkpoint.name = [[NSString stringWithString:chkptName] stringValue];

This seems like some serious overkill to me, though I’m new to Objective-c and iPhone development so I dont know, it may be necessary, in any case this does not work. Before the execution of the second line the value of chkptName is the correct, human readable string that I would like to assign. In theory, if I understand the second line correctly, I simply re-declare an NSString with the value of ckptName, and the read out the actual value of it again with stringValue, which should be the same as getting the value of chkptName. However its in the second line that my app crashes with sigAbrt and when I attempt to check the values of my variable it shows that its of type NSCFString, with an invalid summary for the value. At this point I am at a loss on how to fix this. I have correctly modified entity attributes before and have not run into this problem before.

It is probably also worth noting that I started this out much simpler:

checkpoint.name = [attributeDict objectForKey:@"name"];

But this yielded the same sigAbrt and incorrect selector error.

Edit: Full Error as requested:

2011-08-02 07:25:00.544 MyApp[16011:207] -[NSCFString stringValue]: unrecognized selector sent to instance 0x5c174e0
2011-08-02 07:25:00.545 MyApp[16011:207] * Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[NSCFString stringValue]: unrecognized selector sent to instance 0x5c174e0’

Edit2: Debugger Output:

(gdb) po checkpoint
<Checkpoint: 0x5a30730> (entity: (null); id: (null) ; data: {})
(gdb) po [checkpoint class]
Checkpoint
(gdb) po [checkpoint entity]
Can't print the description of a NIL object.

Any clarification that you can provide is much appreciated, if there is also some relevant code that I missed please ask and I will be happy to provide it if possible. Thanks!

-Karoly

  • 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-24T05:45:51+00:00Added an answer on May 24, 2026 at 5:45 am

    I think you should take a careful look and verify that your checkpoint variable really is an instance of the Checkpoint class.

    1. Verify that the class is properly setup in your Core Data model.
    2. Set a breakpoint at run-time and print the object in the debugger: po checkpoint.
    3. Verify the entity of the object at run-time with: po [checkpoint entity].
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm parsing an XML file, the creators of it stuck in a bunch social
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I am currently running into a problem where an element is coming back from
this is what i have right now Drawing an RSS feed into the php,

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.