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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:55:39+00:00 2026-05-17T18:55:39+00:00

I am creating annotations from database. But when I click on annotation to show

  • 0

I am creating annotations from database. But when I click on annotation to show bubble application crashes. But when I hardcode the coordinates and create placemarks on map the bubbles popup successfully. below is the code I am fetching from database and loading annotations.

-(void) mapView:(MKMapView *)imnMapView didAddAnnotationViews:(NSArray *)views;
{

    BOOL *regionSet=FALSE;


                while(sqlite3_step(compiledStatement) == SQLITE_ROW)
                {
                    CLLocationCoordinate2D userCoods1;
                    NSString *lat = [NSString stringWithUTF8String:(char *) sqlite3_column_text(compiledStatement, 3)];
                    NSString *longg = [NSString stringWithUTF8String:(char *) sqlite3_column_text(compiledStatement, 4)];
                    float fLat = [lat floatValue];
                    float fLong = [longg floatValue];


    userCoods1.latitude = (CLLocationDegrees)fLat;

    userCoods1.longitude = (CLLocationDegrees)fLong;

                    if(regionSet == FALSE)
                    {
                        MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance(userCoods1,400000,500000);
                        [mapView setRegion:region animated:YES];
                        regionSet=TRUE;
                    }

                    NSString *siteName = [NSString stringWithUTF8String:(char *) sqlite3_column_text(compiledStatement, 1)];
                    NSString *siteAddress = [NSString stringWithUTF8String:(char *) sqlite3_column_text(compiledStatement, 2)];


                    ParkPlaceMark *placemark=[[ParkPlaceMark alloc] initWithCoordinate1:userCoods1 title:siteName subtitle:siteAddress atm:@"ATM"];
                    pDescription = @"ATM";

                    [mapView addAnnotation:placemark];
                    [placemark release];

                }

            }               

            sqlite3_finalize(compiledStatement);

        }   

}

And When i just change the userCoords hardcoded and create three different placemarks the bubbles popup and works fine. Please help me getting out of this. 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-05-17T18:55:39+00:00Added an answer on May 17, 2026 at 6:55 pm

    Why don’t you save the latitude and longitude values as a decimal or as a float in the database? It is way more easier to convert it.

    Can you log the values, using NSLog, that are in lat and longg? Are they converted and stored right in flat and flong?

    NSLog(@"String - Latitude: %@ Longitude: %@", lat, longg);
    NSLog(@"Float  - Latitude: %f Longitude: %f", fLat, fLong);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to automatically create javax.persistence.Entity classes from an existing database (or
Creating a patch is very easy in SubVersion, With Tortoise, you right-click and select
When creating a web application, and lets say you have a User object denoting
I have the following table in a SQLite3 database: CREATE TABLE overlap_results ( neighbors_of_annotation
Application configuration: Web application using java first method of creating JAX-WS 2.0 Web Services
I've just read about @Resource annotation from this article ( http://www.infoq.com/articles/spring-2.5-part-1 ) and wish
Creating hashes of hashes in Ruby allows for convenient two (or more) dimensional lookups.
Creating Traversals for Binary Search Tree with Recursion. void inOrder(void (*inOrderPtr)(T&)) { if(this->left !=
Creating an XPathDocument with referenced DTD sometimes throws a web exception. Why?
While creating a file synchronization program in C# I tried to make a method

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.