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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:59:04+00:00 2026-06-07T18:59:04+00:00

i have a tableview which is populated with NSFetchedResultsController. On didSelectRowAtIndexPath i am updating

  • 0

i have a tableview which is populated with NSFetchedResultsController.
On didSelectRowAtIndexPathi am updating the current row. The sorting here should not change. The difference in the selected row is, that i mark it as read. No title changes or something.

In iOS4 the row gets updated and still leave on his current place, it does not move to the end of section. Thats the right way.

in iOS5 the row gets also updated but it moves to the end of the Section. I want to prevent that. How can i do that? And why is that happening?

See my code:

- (NSFetchedResultsController *)fetchedResultsController
{
if (__fetchedResultsController != nil)
{
    return __fetchedResultsController;
}


NSFetchRequest *fetchRequest = [[[NSFetchRequest alloc] init] autorelease];

NSEntityDescription *entity = [NSEntityDescription entityForName:@"EntitySetsCardsInbox" inManagedObjectContext:self.managedObjectContext];
[fetchRequest setEntity:entity];

NSPredicate *inboxPred = [NSPredicate predicateWithFormat:@"archived == 0 AND cardId != 0"];
[fetchRequest setPredicate:inboxPred];


if (sortString == nil) {
    //sortString = [[NSString alloc] initWithString:@"sortingOrder"];
    sortString = [[NSString alloc] initWithString:@"colorOrder"];
    sortAsc = NO;
}


if ([sortString isEqualToString:@"cardTitle"]) {
    NSSortDescriptor *sortDescriptor2 = [[[NSSortDescriptor alloc] initWithKey:sortString ascending:sortAsc selector:@selector(localizedCaseInsensitiveCompare:)] autorelease];
    NSArray *sortDescriptors = [[[NSArray alloc] initWithObjects:sortDescriptor2, nil] autorelease];
    [fetchRequest setSortDescriptors:sortDescriptors];

    XLog(@"sortDescriptors: %@", sortDescriptors);
} else {
    NSSortDescriptor *sortDescriptor2 = [[[NSSortDescriptor alloc] initWithKey:sortString ascending:sortAsc] autorelease];
    NSArray *sortDescriptors = [[[NSArray alloc] initWithObjects:sortDescriptor2, nil] autorelease];
    [fetchRequest setSortDescriptors:sortDescriptors];

    XLog(@"sortDescriptors: %@", sortDescriptors);
}


NSFetchedResultsController *aFetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:self.managedObjectContext sectionNameKeyPath:nil cacheName:nil];
aFetchedResultsController.delegate = self;
self.fetchedResultsController = aFetchedResultsController;

    [...]
}    
  • 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-07T18:59:06+00:00Added an answer on June 7, 2026 at 6:59 pm

    i think your sortdescriptor is changing when you updating your rows. add one more sortdescriptor to fix the list with it and check it again. in my case i have a very similar issue and it solved my problem. maybe yours, too.

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

Sidebar

Related Questions

I have a tableView which should be populated with an NSMutableArray . This worked
I have a tableView which has cells with phone numbers. The app is not
I am developing and tableView in which in each row I have to display
I have Plist which is been populated on the tableview with expanded sections ..now
I have a dynamic tableview which has a prototype cell with a button that,
I am creating a TableView which contains 20 rows.I have to add single labels
I have a tableview, which has many sections. each section has just one cell.
I currently have a tableview, with cell views which have NSTextFields inside of them.
In a tableview I have on every cell a UILongPressGestureRecognizer which I add like
I have a view which I built in Interface builder with a tableview and

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.