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

  • Home
  • SEARCH
  • 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 4325032
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:12:45+00:00 2026-05-21T09:12:45+00:00

I have 2 views with tables. Pressing the + button on one opens the

  • 0

I have 2 views with tables. Pressing the + button on one opens the other table up in a new view and you select the cell and it should then dismiss that view and add the data to a cell in the original view.

I got the 2nd table view all set up. I have to make it so when you select the cell, it adds it to the favorite. Or maybe even select multiple cells, then press the done button, then it adds to favorites. Any ideas on how to go about this? Thanks.

EDIT:

addEvent method just for reference:

-(void)addEvent
{    
    Routine *routine = (Routine *)[NSEntityDescription insertNewObjectForEntityForName:@"Routine" inManagedObjectContext:managedObjectContext];

    routine.name=entered;

    NSError *error = nil;
    if (![managedObjectContext save:&error]) 
    {
        // Handle the error.
    }
    NSLog(@"%@", error);

    //[eventsArray addObject:routine];

    NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];

    NSInteger lastSection = [self.routineTableView numberOfSections] -1;


    [self.routineTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:[self.routineTableView numberOfRowsInSection:lastSection]-1 inSection:lastSection] atScrollPosition:UITableViewScrollPositionBottom animated:YES];
}

EDIT 2

This method is in view1, but needs to be displayed in view2, and the data is selected from view 4.

-(void)addExercise
{    
    Exercise *exercise = (Exercise *)[NSEntityDescription insertNewObjectForEntityForName:@"Exercise" inManagedObjectContext:managedObjectContext];

    exercise.name=entered;

    NSError *error = nil;
    if (![managedObjectContext save:&error]) 
    {
        // Handle the error.
    }
    NSLog(@"%@", error);

    NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];

    NSInteger lastSection = [self.routineTableView numberOfSections] -1;

    [self.routineTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:[self.routineTableView numberOfRowsInSection:lastSection]-1 inSection:lastSection] atScrollPosition:UITableViewScrollPositionBottom animated:YES];
}

EDIT 3:

-(void)addExercise
{    
    if (managedObjectContext == nil) 
    { 
        managedObjectContext = [(CurlAppDelegate *)[[UIApplication sharedApplication] delegate] managedObjectContext]; 
    }

    NSFetchRequest *request = [[NSFetchRequest alloc] init];
    NSEntityDescription *entity = [NSEntityDescription entityForName:@"Exercise" inManagedObjectContext:managedObjectContext];
    [request setEntity:entity];

    NSError *error = nil;
    NSMutableArray *mutableFetchResults = [[managedObjectContext executeFetchRequest:request error:&error] mutableCopy];
    if (mutableFetchResults == nil) {
        // Handle the error.
    }
    [mutableFetchResults release];
    [request release];

    Exercise *exercise = (Exercise *)[NSEntityDescription insertNewObjectForEntityForName:@"Exercise" inManagedObjectContext:managedObjectContext];

    exercise.name=@"Test";

    if (![managedObjectContext save:&error]) 
    {
        // Handle the error.
    }
    NSLog(@"%@", error);

    NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];

    NSInteger lastSection = [self.tableView numberOfSections] -1;

    [self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:[self.tableView numberOfRowsInSection:lastSection]-1 inSection:lastSection] atScrollPosition:UITableViewScrollPositionBottom animated:YES];
    [tableView reloadData];
    [self viewDidLoad];
}
  • 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-21T09:12:46+00:00Added an answer on May 21, 2026 at 9:12 am

    In didSelect method of 2nd tableView you will need to update the datasource of first table and then either call reload when done button is pressed or use insertRowsAtIndex method.

    Thanks,

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

Sidebar

Related Questions

I have the following tables/views Users (View) -> UserId -> Name Roles (Table) ->
I have a view table which is a union of two separate tables (say
I have some view (Views 2 - list of invitations, table style) which uses
I have 2 views in my app 1st view: tableview and button(update) 2nd view:
I have Views field from one of my tables in the database. At first
I have created a grouped table view & I had a edit button in
I have two views that render a table on each. Most of the tables
How to know which objects (tables/views/etc) uses a certain table? I have to replace
We have a set of tables and views that merely store some config data
I have an assortment of database objects (tables, functions, views, stored procedures) each scripted

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.