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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:46:04+00:00 2026-05-27T15:46:04+00:00

I have a UItableview with array of contents in it.There are two array ,I

  • 0

I have a UItableview with array of contents in it.There are two array ,I want to switch the array by using a button click.
My code is

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

tab.backgroundColor = [UIColor clearColor];
tab.separatorColor = [UIColor clearColor];
cell.chapterAndVerse.text = [NSString stringWithFormat:@"%d",indexPath.row+1];
cell.chapterAndVerse.font = [UIFont fontWithName:@"Georgia" size:17.0];
cell.chapterAndVerse.frame=CGRectMake(0, 10, 30.0, 20.0);
cell.textLabel.text =  [NSString stringWithFormat:@"  %@",[delegate.allSelectedVerseMalayalam objectAtIndex:indexPath.row]];

cell.textLabel.font = [UIFont fontWithName:@"testfont" size:18];
cell.backgroundColor = [UIColor clearColor];
}

my array is delegate.allSelectedVerseMalayalam ,I want this array to be changed with delegate.allSelectedVerseEnglish in button click.When the button for english is clicked by the user it changes the tableviewcontent(my table names is tab)to delegate.allSelectedVerseEnglish .How is this possible.Plese help me to figure out from this problem.
Thanks in advance.
EDIT:

 - (void)viewDidLoad {
NSLog(@"%@", delegate.allSelectedVerseMalayalam);
    tempArray = [[NSMutableArray alloc] init];
    [tempArray addObjectsFromArray:delegate.allSelectedVerseMalayalam];
    NSLog(@"%@", tempArray);

    [self.tab reloadData];
}
-(IBAction)_clickbtndefaultlnguageset:(id)sender
{
    [tempArray removeAllObjects];
    [tempArray addObjectsFromArray:delegate.allSelectedVerseHindi];
    [self.tab reloadData];

}

in tableview

cell.chapterAndVerse.text = [NSString stringWithFormat:@"%d",indexPath.row+1];
cell.chapterAndVerse.font = [UIFont fontWithName:@"Georgia" size:17.0];
cell.chapterAndVerse.frame=CGRectMake(0, 10, 30.0, 20.0);
cell.textLabel.text =  [NSString stringWithFormat:@"  %@",[tempArray objectAtIndex:indexPath.row]];

// cell.textLabel.textColor = [UIColor darkGrayColor];
cell.textLabel.font = [UIFont fontWithName:@"testfont" size:18];
cell.backgroundColor = [UIColor clearColor];
  • 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-27T15:46:05+00:00Added an answer on May 27, 2026 at 3:46 pm

    do one thing take one extra array and allocated it
    define in your source file .h file

    NSMutableArray *tempArray;
    
    -(void)viewDidLoad{  
    //NSLog(@"%@", your Array);  
    tempArray = [[NSMutableArray alloc] init];  
    [tempArray addObjectsFromArray:yourfirstarray];  
    NSLog(@"%@", tempArray);  
    [self.tableview reloadData];  
    }
    

    after prees the button

    -(void)pressedBtn{  
    //NSLog(@"%@", your Array);
    [tempArray removeAllObjects];  
    [tempArray addObjectsFromArray:yoursecondArray];  
    [self.tableView reloadData];  
    }
    

    use this temp array into table array

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

Sidebar

Related Questions

I have a UITableView which is populated by an array, I have a button
I have a tableview whose contents are generated with json array. It also employes
I have a UITableView subclass and a UITableViewCell subclass that I'm using for cells.
I have a UITableView which loads data from XML using the below code. It
so basically I have a UITableView and when using it to switch between other
I have a UITableView with a refresh button in toolbar. If the TableView is
I have an array of objects which populate a UITableView . When a user
I have UITableView.when i click on it's 1 st row one another UITableView opens
I have a UITableView with the following code: - (void)viewDidLoad { [super viewDidLoad]; parser
I have a UITableView that was created from data coming from a mutable array.

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.