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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:41:28+00:00 2026-05-18T09:41:28+00:00

EDIT : I have altered the NSPredicate as recommended so that my fetch code

  • 0

EDIT:
I have altered the NSPredicate as recommended so that my fetch code look like so. Having printed to the UITextView like this, when I press load it spits out the following:

<NSManagedObject: 0x1c7cf0>(entity: DatedText; id: 0x1420c0 <x - coredata://B52D4F88-0210-4AE2-9DA6-C05ED64FE389/DatedText/p12> ; data: <fault>)

So either its not getting any data data because it hasn’t been saved/loaded correctly or I am trying to get the loaded result into a UITextView the incorrect way. Any ideas?

NSFetchRequest *fetch = [[NSFetchRequest alloc] init];
    NSEntityDescription *testEntity = [NSEntityDescription entityForName:@"DatedText" inManagedObjectContext:self.managedObjectContext];
    [fetch setEntity:testEntity]; 
    NSPredicate *pred = [NSPredicate predicateWithFormat:@"dateSaved == %@", datePicker.date];
    [fetch setPredicate:pred];

    NSError *fetchError = nil;
    NSArray *fetchedObjs = [self.managedObjectContext executeFetchRequest:fetch error:&fetchError];
    if (fetchError != nil) {
        NSLog(@" fetchError=%@,details=%@",fetchError,fetchError.userInfo);
        return nil;
    }
    NSString *object = [NSString stringWithFormat:@"%@",[fetchedObjs objectAtIndex:0]];
    noteTextView.text = object;

I have been having all sorts of problems working out how to use Core Data, so I have gone back to basics, new window based ipad project using core data.

I have added a view and some code which doesn’t work, hehe. Im basically trying to save some text to a date, then when going back to that date, the text which was previously saved will be shown again.

  • 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-18T09:41:29+00:00Added an answer on May 18, 2026 at 9:41 am

    I checked your project and aside from having to synthesize the CoreData properties, I also just noticed you were trying to assign an NSArray to your fetch predicate, but it actually expects an NSPredicate object. You should use this instead:

    NSPredicate *pred = [NSPredicate predicateWithFormat:@"(dateSaved == %@)", datePicker.date];
    [fetch setPredicate:pred];
    

    If you want to set more than 1 predicate you should do that on your predicate string i.e.

    NSPredicate *pred = [NSPredicate predicateWithFormat:@"(dateSaved == %@) AND (dateSaved <= %@", datePicker.date, [NSDate date]];
    

    Cheers,
    Rog

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

Sidebar

Related Questions

Edit: I have solved this by myself. See my answer below I have set
EDIT: I have submitted a bug report and Microsoft have acknowledge that it is
I have a control that I would like to be static, but instead of
Edit: I'd like to plead temporary insanity for even asking this question, but it
I have this jQuery code; $(function () { $(window).unbind(beforeunload); $(window).bind(beforeunload, function () { return
(EDIT: I have asked the wrong question. The real problem I'm having is over
I have a mapping like this <class name=UserFileSummary table=UserFile lazy=false> <id name=FileId column=UserFileId type=int>
EDIT: I have added Slug column to address performance issues on specific record selection.
What are extension methods in .NET? EDIT: I have posted a follow up question
EDIT: I also have access to ESXLT functions. I have two node sets of

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.