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

  • Home
  • SEARCH
  • 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 6532255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:58:42+00:00 2026-05-25T09:58:42+00:00

I have a ViewController called CortesViewController which has a MKMapView Called mymap. I have

  • 0

I have a ViewController called “CortesViewController” which has a MKMapView Called mymap. I have a function showAddress which is defined in CortesViewController.h and implemented in corresponding .m file.

- (void) showAddress:(float) lat :(float) lon :(int) keytype
{
centerCoordinate.latitude = lat;
    centerCoordinate.longitude = lon ;
        NSLog(@"with key = 0, lat lon are %f, %f", centerCoordinate.latitude, centerCoordinate.longitude);
    [mymap setCenterCoordinate:centerCoordinate animated:TRUE] ;
}

I have another UitableViewController “PlacesViewController” which contains list of places with Name and Latitude and Longitude and Can be brought to front by a button placed on CortesViewController. When clicked on any place’s name I want to return to to mymap showing selected place at center of map. So I am Calling “showAddress” function

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

in PlaceViewController.m . Implementation is shown below.

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

    Place *placeAtIndex = (Place *)[appDelegate.PlacesArray objectAtIndex:indexPath.row];

    NSLog(@"required lat long is %f, %f ", placeAtIndex.PlaceLatitude, placeAtIndex.PlaceLongitude);


    CortesViewController *returnToMap = [[CortesViewController alloc] init];



    float tableLatitude = placeAtIndex.PlaceLatitude ;
    float tableLongitude = placeAtIndex.PlaceLongitude;
    [returnToMap showAddress :tableLatitude :tableLongitude : 0];   

    [self.navigationController dismissModalViewControllerAnimated:YES];
    }

code runs without error or warning but view in mymap don’t change despite clicking on a place that has a different latitude and longitude. showAddress takes input values lat, lon correctly as stored in UITableView in PlaceViewController.m. But the line

[mymap setCenterCoordinate:centerCoordinate animated:TRUE] ;

dont seem to work when called from

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath.

Please help. Thanks for any help 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-25T09:58:43+00:00Added an answer on May 25, 2026 at 9:58 am

    It seems that you are changing some values in this line

    [returnToMap showAddress :tableLatitude :tableLongitude : 0];

    If in showAddress you are changing view also than probably it may not reflect changes in some cases(Read details of Thread and UI component interaction in iOS).

    So, I will suggest you just change variables in showAddress and apply changes in view accordingly in viewWillAppear method of CortesViewController

    If above is not applicable in you case then post here so that I can understand problem in detail.

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

Sidebar

Related Questions

I have a viewController called MainViewController, which has a UIButton. When tapped, this button
I have a viewcontroller with a nib - which has a tableview, searchbar and
I have splitViewController which has as MasterViewController some viewController and as DetailViewController some tableViewController.
I have a custom viewController called SourceListViewController, and I'm adding it into a UINavigationController,
I have a ViewController class called GamePlay. In GamePlay there is a nested class
Let's say I have an abstract class called ViewController, and another abstract class called
So I have a ViewController Class which is my first view, I then add
I have a viewController called HaveScrollController, and this is something like this: @interface HaveScrollController
I have a ViewController that contains a UITableView in which the cells are created
I have subclass a UITableViewCell as follows: @class MyCell; @protocol MyCellDelegate - (void) viewController:(MyCell*)viewCon

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.