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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:14:55+00:00 2026-06-08T08:14:55+00:00

I want to reload(refresh) my mainviewcontroller after changes. I add some data to data

  • 0

I want to reload(refresh) my mainviewcontroller after changes. I add some data to data model and after save operation I put buttons to data elements on my main view. In second controller I make a edition section in which I change or delate data from base. My question is: How can I reload main view after delating element from base. My code for creating buttons is in mainviewcontroller:

 NSFetchRequest *request = [[NSFetchRequest alloc] init];
    NSEntityDescription *entity = [NSEntityDescription entityForName:@"Destination" inManagedObjectContext:_managedObjectContext];
    [request setEntity:entity];
    NSError *error = nil;
    mutableFetchResults = [[_managedObjectContext executeFetchRequest:request error:&error] mutableCopy];

    CGFloat y = 130.;

    for (int i = 0; i < [mutableFetchResults count]; i++) {


        UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
        [button setBackgroundImage:[UIImage imageNamed:[NSString stringWithFormat:@"ikonki%d.png",i]] forState:UIControlStateNormal];


        [button setTitle:@"Test"  forState:UIControlStateNormal];
        NSLog(@"%@",_destination3.nazwa);
        [button setTitleColor: [UIColor whiteColor] forState: UIControlStateNormal];
        [button setEnabled:YES];

        [button addTarget:self
                   action:@selector(buttonHandler:) 
         forControlEvents:UIControlEventTouchUpInside];

        button.tag = i;
        button.frame = CGRectMake(x, y, 64 , 64); 
  • 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-08T08:14:57+00:00Added an answer on June 8, 2026 at 8:14 am

    Do you know NSFetchedResultsController? Go to documentation and look at DataSectionTitles and iPhoneCoreDataRecipes samples. Here you can find how to use this class. Basically this class gets your fetch request, listens for changes and if you delete / insert / update / … objects in your NSManagedObjectContext it triggers delegate methods where you can update your view.

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

Sidebar

Related Questions

I want to reload the data within a table view that is contained on
If I want a whole page to reload every N seconds, I would put
I have an asp.net CheckBox, now I want to reload page after check or
What's the best way to refresh a given model attribute? I.e., functionally, I want
I want my app to reload data as soon as the app switches from
I want to simulate a click, $(#genStats).trigger(click); every time I refresh the page window.location.reload()
I am using telerik treeview with telerik chart control. I want to refresh/reload the
I can use location.reload(true) to refresh the page and refetch the page. I want
I want to reload the content of the page I am on, so I
I want to reload my page (PHP) on changing value from the dropdownmenu 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.