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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:16:04+00:00 2026-06-18T14:16:04+00:00

When I try to get a string value from an NSManagedObject, I get this

  • 0

When I try to get a string value from an NSManagedObject, I get this

<Entity: 0x1e043140> (entity: Entity; id: 0x1e041c30 <x-coredata://8F48C331-B879-47B4-B257-4802A13ED12C/Entity/p4> ; data: {
number = "<UITextField: 0x1d8b7cc0; frame = (159 183; 161 30); text = 'test'; clipsToBounds = YES; opaque = NO; autoresize = RM+BM; gestureRecognizers = <NSArray: 0x1d8b3c10>; layer = <CALayer: 0x1d892a30>> : ";
})

how do I get the string from this (it’s text = ‘test’;)

i get the object using this

NSString *rowValue = [self.fetchedResultsController objectAtIndexPath:indexPath];

ok, well the nsmanaged object is this and sets a uitableview cell to its string

NSManagedObject *object = [self.fetchedResultsController objectAtIndexPath:indexPath];

cell.textLabel.text = [[object valueForKey:@"number"] description];

The reason it’s showing what it does is because, as you can see, I am getting it’s description. I can’t find a property that would return the text value, so does anyone know how? 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-18T14:16:05+00:00Added an answer on June 18, 2026 at 2:16 pm

    I assume that the error already occurs when you store a value in the managed object. Perhaps you do something like

    [myObject setValue:[aTextField description] forKey:@"number"]
    

    instead of storing the text field’s text contents:

    [myObject setValue:[aTextField text] forKey:@"number"]
    

    UPDATE: As you write in a comment, the managed object values are stored as

    NSString *string = [NSString stringWithFormat:@"%@ : %@", self.numtext, self.comtext];
    [newManagedObject setValue:string forKey:@"number"];
    

    But the %@ format for a UITextField itself is expanded to the text fields description, not the text contents. Therefore the string already looks like

    "<UITextField: 0x1d8b7cc0; frame = (159 183; 161 30); text = 'test'; .... "
    

    and this string is stored as “number” attribute in the managed object. You should use the following code instead:

    NSString *string = [NSString stringWithFormat:@"%@ : %@", self.numtext.text, self.comtext.text];
    [newManagedObject setValue:string forKey:@"number"];
    

    Note that you have to delete the old database when testing this to get rid of the already existing wrong entries.

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

Sidebar

Related Questions

I try to get string from this url: http://autoc.finance.yahoo.com/autoc?query=google&callback=YAHOO.Finance.SymbolSuggest.ssCallback When I look at this
I get this error when I try to use time_ago_in_words : Comparison of String
I'm getting String value from Webservice & try to display String value in Edittext
Please help me to solve this. I trying to get value from textview and
I construct a string with a value I get from another activity: Bundle b
I have the following code and when i try to get a value from
I try to replace few characters in some string 14/04/2010 17:12:11 and get, for
I try to get to a page straight from Bash at http://www.ocwconsortium.org/ . The
I am trying to take a string'd date value from an element, and convert
How to get value from adapter position, i have code in below: CategoriesXmlParser categoryXmlParser

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.