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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:04:29+00:00 2026-05-28T16:04:29+00:00

I am new to coding and I’ve been making great progress… until now! I’ve

  • 0

I am new to coding and I’ve been making great progress… until now! I’ve been setting up an application for the iPhone but I’ve run into a wall.

I’m trying to send the searchString from my HomeViewController‘s UISearchBar to my tableViewController‘s UISearchBar, and then I want my TableViewController‘s UISearchBar to automatically execute a search based upon the initial searchString, thus populating the TableViewController‘s table with a filtered array.

When I use the home view’s searchBar, it does push the application to the table view, however, the database’s array isn’t filtered. The table view does have a functional UISearchBar that can filter my array based upon various searchStrings that I feed it.

I’ve tried many things based upon examples I’ve found through google, but nothing seems to work.

Here is my relevant code. (I’ve left out a bit of code that I think is irrelevant to the problem at hand).

HOME VIEW CONTROLLER

@interface HomeViewController : UIViewController <UISearchBarDelegate>
{

NSString *pushedSearchString;    
UISearchBar *homeSearchBar;

}

@property (strong) NSString *pushedSearchString;    
@property (nonatomic,strong) IBOutlet UISearchBar *homeSearchBar;

...    
...    
...

@implementation HomeViewController

@synthesize pushedSearchString, homeSearchBar;

- (void)updateSearchString:(NSString*)aSearchString    
{    
pushedSearchString = [[NSString alloc] initWithString:aSearchString];    
}    
- (void)searchBarButtonClicked:(UISearchBar *)searchBar    
{    
[self updateSearchString:searchBar.text];    
[searchBar resignFirstResponder];    
TableViewController *tableViewController = [self.storyboard insantiateViewControllerWithIdentifier:@"table"];    
table.title = @"Results";    
[self.navigationController pushViewController:table animated:YES];    
}

…

…

…

My TableViewController looks similar although it has slightly different variables. I’ve tried manipulating code inside the -(void)viewWillAppear:(BOOL)animated method, as I’ve seen via other posts, but nothing worked.

I would greatly appreciate any help I can get – thanks for reading this and thanks for your time!

  • 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-28T16:04:30+00:00Added an answer on May 28, 2026 at 4:04 pm

    Declare the property for a NSString in Tableviewcontroller.And synthesize it in .m file.And make the below change in your homeviewcontroller method.

    - (void)searchBarButtonClicked:(UISearchBar *)searchBar    
    {    
    [self updateSearchString:searchBar.text];    
    [searchBar resignFirstResponder];    
    TableViewController *tableViewController = [self.storyboard insantiateViewControllerWithIdentifier:@"table"];
    table.someString = searchBar.text;
    table.title = @"Results";    
    [self.navigationController pushViewController:table animated:YES];    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm pretty new to coding with streams but now I have to do it
I'm relatively new to coding; most of my work has been just simple GUI
I am new to coding in Objective-C, but am coming from the Java world
I have been coding in java for a while now .... i want to
Brand new to coding; been utilizing stackoverflow religiously for months; first time asking a
I'm new in C# but not new to coding --being doing it for almost
I'm fairly new to coding in T-SQL and have run into an issue I
Quite new to coding for android but this issue has me tearing my hair
I am essentially brand new to coding (html5 forms, CSS3 and now jQuery). What
New to all coding worlds and new to RoR. I have been doing 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.