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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:47:17+00:00 2026-06-12T13:47:17+00:00

I have a core data database that is filled up with data coming from

  • 0

I have a core data database that is filled up with data coming from a json webservice.
But I have a problem with the date. This date is coming back like a string. So first thing I want to do is to transform this string to a NSDate. The second thing is to transform this NSDate in the right format so that I can add a sort descriptor on date.

This is what I have at the moment for how I store my date in the core data database.

 NSDateFormatter* df = [[NSDateFormatter alloc] init];
    [df setDateFormat:@"MM/dd/yyyy"];
    NSDate* d = [df dateFromString:[genkInfo objectForKey:CALENDAR_DATE]];

    kalender.date              = d;

And how I get my data.

- (void)getKalender // attaches an NSFetchRequest to this UITableViewController
{
    NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:@"Kalender"];
    request.sortDescriptors = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"date" ascending:YES]];

    self.fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:request
                                                                        managedObjectContext:self.genkDatabase.managedObjectContext
                                                                          sectionNameKeyPath:nil
                                                                                   cacheName:nil];

}

Any idea how to do this?

Kind regards and thank in advance

EDIT

When I do the following log. I get for each record the correct date and a null value

  NSLog(@"date  = %@",kalender.date);

    2012-10-08 19:17:12.125 RacingGenk[596:c07] date  = 2013-09-02 22:00:00 +0000
    2012-10-08 19:17:12.125 RacingGenk[596:c07] date  = (null)
  • 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-12T13:47:18+00:00Added an answer on June 12, 2026 at 1:47 pm

    As it turned out in the discussion, the format used by the date formatter did not match for date format sent by the web service. Using

    [dateFormatter setDateFormat:@"dd/MM/yyyy"]
    

    fixed the problem.

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

Sidebar

Related Questions

I have a UITableview cell that gets a tally from a core data database.
i have a core data database that start from the AppDelegate, and there i'll
I have a Core Data in this database should I save images, so how
I have some calculated values in the core data database that I need to
Really weird problem. I have a tableView that pulls data out of a Core
I have a core data model, using the database store, that contains entities with
I have a sample program that use Core Data and load an sqlite database
I have a Core Data class Meeting with a property date which I want
I have a core data object and a REST web interface that use different
I have a Core Data based mac application that is working perfectly well until

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.