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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:48:04+00:00 2026-05-26T18:48:04+00:00

I have a problem on a tableview with section by date. I took the

  • 0

I have a problem on a tableview with section by date.
I took the Apple example : DateSectionTitles

I don’t care about year. I ust need month and day.
So I adapt my code like that :

In my CoreData class :

- (NSString *)sectionIdentifier {
[self willAccessValueForKey:@"sectionIdentifier"];
NSString *tmp = [self primitiveSectionIdentifier];
[self didAccessValueForKey:@"sectionIdentifier"];
NSLog(@"!Temp");
if (!tmp) {
    NSCalendar *calendar = [NSCalendar currentCalendar];

    NSDateComponents *components = [calendar components:(NSMonthCalendarUnit | NSDayCalendarUnit) fromDate:[self timeStamp]];
    tmp = [NSString stringWithFormat:@"%d", ([components month]*100) + [components day]];
    [self setPrimitiveSectionIdentifier:tmp];
}
return tmp;}

And in my titleForHeaderInSection method in my main controller :

NSInteger month = numericSection / 100;
NSInteger day = numericSection - (month * 100);

NSString *titleString = [NSString stringWithFormat:@"%d %d",day, month];

return titleString;

But when I run my app I have this message :

CoreData: error: (NSFetchedResultsController) A section returned nil value for section name key path ‘sectionIdentifier’. Objects will be placed in unnamed section

Do you know why ?
Thanks for your help !

  • 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-26T18:48:05+00:00Added an answer on May 26, 2026 at 6:48 pm

    Logically, that would happen if at this line of your code

    NSDateComponents *components = [calendar components:
       (NSMonthCalendarUnit | NSDayCalendarUnit) 
       fromDate:[self timeStamp]];
    

    [self timeStamp] returns an invalid NSDate. Check with NSLog statements if that is the case.

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

Sidebar

Related Questions

I have a problem while scrolling images on tableview. I am getting a Signal
I have two tableView sections, sometimes the first section dosen't have any data in
Actually I have textfield in my sixth section of the tableview and a textview
I have a problem with a tableview and a custom cell. I have the
I have this wierd problem with my table i Have about 20 cells to
I have one problem with two sections in UITableview grouped style. First section having
I have a weird problem with the indexPath.section from the cellForRowAtIndexPath: method. I have
I have encountered a problem of placing data into the Table View. Here is
I have a flash app embedded in a yui TabView tab div, the problem
I have problem in some JavaScript that I am writing where the Switch statement

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.