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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:17:03+00:00 2026-06-15T12:17:03+00:00

I am making an IPhone app and I have a table view that is

  • 0

I am making an IPhone app and I have a table view that is pulling data from Core Data using an frc controller and it displays stuff sorted by title. If the user navigates to the next screen they can click one of three buttons that should change the sort descriptor in the frc. How can I call that frc on the next screen and change it’s sort descriptor based on the button the user presses?

- (IBAction)btnValue:(id)sender {

}


- (NSFetchedResultsController *)frc_Work

{

// If the frc is already configured, simply return it

if (_frc_Work) return _frc_gradedWork;



// Otherwise, create a new frc, and set it as the property (and return it below)

_frc_Work = [_cdStack frcWithEntityNamed:@"GradedWork" withPredicateFormat:nil predicateObject:nil sortDescriptors:@"title,YES" andSectionNameKeyPath:nil];



return _frc_Work;

}

  • 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-15T12:17:03+00:00Added an answer on June 15, 2026 at 12:17 pm

    Use delegate or Notifications to do the communication between the screens whenever a button in next screen is pressed.

    on notification keep the sort descriptor as a property. Change it when u recive the notification and set a dirty flag variable whose value you will check in viewWillAppear to reload the page.

    Detailed Explanation:

    You have Two screens (I am assuming two view controllers)

    First Screen shows sorted data based on certain criteria.
    while querying core data , you need to pass this NSSortdescriptor to the request to fetch the right data.

    This screen will have an NSSortDescriptot property.

    Second screen shows three buttons, have a common IBAction for them.
    based on the Button pressed call a delegate method say SortingCriteriaChanged:(NSSortDescriptor *sortDescriptor),
    Create and passthe appropriate sort descriptor to this delegate method.
    Before pushing this second screen, set the first screen as delegate to this screen and also implement the above method.

    In the delegate method set the sortDescriptor to the one passed to delegate method.

    Now dont reload anything.

    When you come back to the previous screen, viewWillAppear gets called. here you should reload the sorted list that too only if sorting criteria has chnaged.

    For this you need a BOOL property say: needToReload.
    set it to YES in delegate method and check its value in viewWillAppear and reload the list.
    after reloading of list is done, set the BOOL property to NO again.

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

Sidebar

Related Questions

I'm making an iphone app that uses NSURLConnection to download some data from the
i am making an iphone app that get data from web ,i use HPPLE
I am making an iPhone App and I have an NSDate in Core data
I am making an iPhone app that gets data from a web service and
I'm having some trouble with an iPhone app that I'm making. I have two
I am making an iPhone app. I have a code that is in C.
I'm making an iPhone app in which I retrieve JSON data from http://maps.googleapis.com/maps/api/geocode/json?address=canada&sensor=true ,
I'm making an iPhone app that uses Core Plot at one point in the
I am making an iPhone app using WSDL Web-Services, but I have no idea
I will be making an iPhone app that will sell ebooks. we have a

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.