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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:27:14+00:00 2026-06-16T01:27:14+00:00

I m acccomplishing autocomplete textfield feature for a textfield.I have done it but the

  • 0

I m acccomplishing autocomplete textfield feature for a textfield.I have done it but the performance time is slow,which means when I press any character on the keypad then first the letter is zooming and then it is being displayed in textfield after sometime .Actually my list for autocomplete feature is taken from a service url.What is need is as soon as I type a character on keypad I need it to be displayed within a fraction of seconds.I knew it takes sometime to appear as it is being checked in service url and its list.But atleast if I could gain it somewhat faster than now then it would be gud.

This is the code I m working on.

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {

    if(textField==CompanyName)
    {

        autocompleteTableView.hidden = NO;

        NSString *substring = [NSString stringWithString:textField.text];
        substring = [substring stringByReplacingCharactersInRange:range withString:string];
        [self searchAutocompleteEntriesWithSubstring:substring];
        return YES;
        if([CompanyName.text length]==0)
        {
            autocompleteTableView.hidden = YES;

        }
    }


}

- (void)searchAutocompleteEntriesWithSubstring:(NSString *)substring {

    NSString *urlString= [NSString stringWithFormat:@"http://221.190.132.116/services/AutoCompService.svc/GetEmpNames/?p=%@",substring];     
    NSURL *jsonUrl =[NSURL URLWithString:urlString];
    NSURLRequest *request = [NSMutableURLRequest requestWithURL:jsonUrl];
    NSOperationQueue *queue = [[NSOperationQueue alloc] init];
    [NSURLConnection sendAsynchronousRequest:request queue:queue completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
    parser = [[NSXMLParser alloc] initWithData:data];
    currentHtmlElement=@"5";
    [parser setDelegate:self];
    [parser setShouldProcessNamespaces:NO];
    [parser setShouldReportNamespacePrefixes:NO];
    [parser setShouldResolveExternalEntities:NO];
    [parser parse];
    [parser release];


    if([arr4 count]!=0)
    {
         self.autocompleteUrls = [[NSMutableArray alloc] init];
         if(autocompleteTableView)
             [autocompleteTableView removeFromSuperview];
         autocompleteTableView = [[UITableView alloc] initWithFrame:CGRectMake(10, 110, 195, [arr4 count]*30) style:UITableViewStyleGrouped];
         autocompleteTableView.delegate = self;
         autocompleteTableView.dataSource = self;
         autocompleteTableView.scrollEnabled = YES;
         autocompleteTableView.backgroundColor = [UIColor lightTextColor];
         autocompleteTableView.rowHeight=28;
         autocompleteTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
         [self.view addSubview:autocompleteTableView];
         [autocompleteUrls removeAllObjects];
         for(int i=0;i<[arr4 count];i++)
         {
             NSString *curString = [[arr4 objectAtIndex:i] valueForKey:@"Name"];
             [autocompleteUrls addObject:curString];

         }




     }
     [autocompleteTableView reloadData];
}];


     }
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

    UITableViewCell *selectedCell = [tableView cellForRowAtIndexPath:indexPath];
    CompanyName.text = selectedCell.textLabel.text;
    autocompleteTableView.hidden=YES;


}


}

how can I accomplish this feature alternativtly?

  • 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-16T01:27:16+00:00Added an answer on June 16, 2026 at 1:27 am

    you can use NSURLConnection has methods for performing the request asynchronously. You just give it a delegate or a completion block and it will call you when the request is complete.

    Try this example http://x-techteam.blogspot.in/2011/10/asynchronous-web-service-client-using.html

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

Sidebar

Related Questions

I have been approached regarding building a touch screen app for a client, but
I have a file which is in project folder my wampserver www directory and
I'm stuck with a LINQ query (or any other efficient means of accomplishing the
I have a set of configuration settings (key/value) pair, which is meant for customization
I am trying to do a seemingly simple thing, but having trouble accomplishing it.
is there any way of accomplishing something like the following: CREATE FUNCTION GetQtyFromID (
Does anyone has any solutions on accomplishing asynchronous cross-domain GET requests. I am looking
Is there any way to measure code coverage with DUnit? Or are there any
Is there any shortcut to accomplishing the equivalent of PHP's array_flip function in JavaScript
Is there any way to assign a static function to a variable, or accomplishing

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.