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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:57:14+00:00 2026-06-04T08:57:14+00:00

I have a searchbar in my view which is to be used by users

  • 0

I have a searchbar in my view which is to be used by users to enter a keyword and searching according to that. I am using uisearchbar delegate for this. Right now the map is coming in center for which the keyword is being searched for, but I also want to display the call out related to that. I have lat long and title, which i assume would be useful.
Here is the code:

- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar{
     NSLog(@"text %@",searchBar.text);
    NSEnumerator *enumerator = [res objectEnumerator];
    id obj;
    NSString *stringToSearchFor = [searchBar text];
    stringToSearchFor= [stringToSearchFor lowercaseString];
    NSString *searchInThisString = @"";
    while(obj = [enumerator nextObject]){
        searchInThisString = [obj title];
        searchInThisString = [searchInThisString stringByAppendingString:@" "];
        searchInThisString = [searchInThisString stringByAppendingString:[obj address]];
        searchInThisString = [searchInThisString lowercaseString];
        if([searchInThisString rangeOfString:stringToSearchFor].location == NSNotFound ){
            NSLog(@"not found ");
            continue;
        }else{
            NSLog(@"found");

            NSString *lat = [obj latitude];
            NSString *longi = [obj longitude];
            MKCoordinateRegion region = self.gpMapView.region;
            region.center.latitude = [lat doubleValue];
            region.center.longitude = [longi doubleValue];
            id<MKAnnotation> myAnnotation = [self.gpMapView.annotations objectAtIndex:0];
            MKAnnotationView *mkv = [[MKAnnotationView alloc]init];
            [mkv setSelected:YES];
            [self.gpMapView selectAnnotation:myAnnotation animated:YES];
            [self.gpMapView setRegion:region animated:YES];

            break;
        }
    }

How can i trigger callout bubble any ideas please?

  • 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-04T08:57:16+00:00Added an answer on June 4, 2026 at 8:57 am

    I’m sure you’ve solved this but just in case … according to Apple docs, SelectAnnotation only works if the pin is ALREADY visible onscreen.

    MKMapView Class Reference > SelectAnnotation
    If the specified annotation is not onscreen, and therefore does not have an associated annotation view, this method has no effect.

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

Sidebar

Related Questions

I have a UISearchbar with delegate method - (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText { if(searchText.length>3){
I have a UISearchBar which is subviewed by another view when a button is
I have a view controller which contains a UISearchBar @interface TradeFindHeaderViewController_iPhone : UIViewController {
I have a view controller called vc0 which is presented like this: [self presentViewController:
I have a UISearchBar below a header-view. This header is 64px hight. If the
I have implemented searchbar and searching text in table view . The problem I
have written this little class, which generates a UUID every time an object of
I have a selectedArray defined as a property in my file that holds which
imagine i have a main view, in which i have a call to the
I have a ordinary UITableViewController inside a UINavigationController. The former includes a searchbar which

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.