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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:06:30+00:00 2026-06-15T08:06:30+00:00

I am new to ios programming, need to implement something like a google search

  • 0

I am new to ios programming, need to implement something like a google search box i.e., autofill text field.
My scenario is as follow
1.when user type in text field
2.background call to webservice for data(request data= text field data).

for example:- if user type “abc” in text field request data for web service call should be “abc” and web service gives response on that. Now next time user type “d” i.e textfield contains “abcd” service response must consider the appended text.(something like google search field)
3.web service call should be Asynchronous.
4.response should be displayed in drop down list.

Is it possible in ios???
Any tutorial or example would be appreciated.
Thanks in advance.

  • 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-15T08:06:32+00:00Added an answer on June 15, 2026 at 8:06 am

    I will assume you are talking about a Restful webservice and NOT SOAP, for the love of god!

    Yes, of course it is possible. You can follow this approach, I could use an HTTP lib such as AFNetworking to make the request but for the sake of simplicity I’m just init’ing the NSData with the contents of URL on background and updating UI on main thread using GCD.

    1. Set your UITextField delegate to the ViewController you are working on viewDidLoad: method

      textField.delegate = self;
      
    2. override the UITextField delegate method textField:shouldChangeCharactersInRange:replacementString: with:

      - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
      
          // To increase performance I advise you to only make the http request on a string bigger than 3,4 chars, and only invoke it
          if( textField.text.length + string.length - range.length > 3) // lets say 3 chars mininum
          {
              // call an asynchronous HTTP request
              dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
      
                  NSURL * url = [[NSURL alloc] initWithString:[NSString stringWithFormat:@"http:/example.com/search?q=%@", textField.text]];
                  NSData * results = [NSData dataWithContentsOfURL:url];
                  NSArray * parsedResults = [NSJSONSerialization JSONObjectWithData: results options: NSJSONReadingMutableContainers error: nil];
                 // TODO: with this NSData, you can parse your values - XML/JSON
                 dispatch_sync(dispatch_get_main_queue(), ^{
                     // TODO: And update your UI on the main thread
                     // let's say you update an array with the results and reload your UITableView
                     self.resultsArrayForTable = parsedResults;
                     [tableView reloadData];
                 });
              });
      
          }
      
          return YES; // this is the default return, means "Yes, you can append that char that you are writing
          // you can limit the field size here by returning NO when a limit is reached
      }
      

    As you can see there are a list of concepts that you need to get used to:

    • JSON parsing (I could parse XML, but why?! JSON is way better!)
    • HTTP Request (you can use AFNetworking instead of what I’ve done above)
    • Asynchronous HTTP requests (do not block main thread)
    • GCD (the dispatch_async stuff)
    • Delegates (in this case for UITextField)

    Performance update

    • when checking if the size is bigger than 3 chars, you can even only make HTTP request every 2/3 chars, let’s say, only request if length % 3.

    I suggest you read something about those

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

Sidebar

Related Questions

I'm new to iOS programming and I need to implement a location aware application.
I am new at ios programming and I need some help, can't figure out
I'm new to iOS programming and I'm spending way too much time on something
i am new to iOS programming. i really need your help. i have a
Hi I am new to iOS programming and I need a little help. I
I'm a new iOS programming and I'm developing a simple iPhone game that needs
I'm new to IOS programming, I don't know how to judge the swinging direction
I'm new to iOS programming. I want to know how a database is created
i'm just new to iOS Programming, so appreciate for any help. I'm trying to
I am new to iOS programming. I see that there are functions defined in

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.