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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:19:52+00:00 2026-06-09T07:19:52+00:00

I am making an app that will use the MKMapKit for the pins and

  • 0

I am making an app that will use the MKMapKit for the pins and annotations. I want to display more information besides some text, so I created a button in the callout so I could make that go to another view controller. At the moment, the button in the callout doesn’t do anything, as there is no code to make it work. It would be great if someone could make the code for the button to go to a different view controller!

The header file

#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>
#import <CoreLocation/CoreLocation.h>

#define METERS_PER_MILE 1609.344



@interface MSKSecondViewController :UIViewController<MKMapViewDelegate>
{
IBOutlet MKMapView *stillwellMapView;
int difficultyOfTrailOverlay;
}

@property (nonatomic, assign) CLLocationCoordinate2D mainEntranceToStillwellCoordinate;

@end

Here is the implementation file

#import "MSKSecondViewController.h"
@interface MSKSecondViewController ()

@end

@implementation MSKSecondViewController
@synthesize mainEntranceToStillwellCoordinate;


- (void)viewDidLoad
{

[super viewDidLoad];
stillwellMapView.delegate=self;
// Do any additional setup after loading the view, typically from a nib.
[self mainEntrancetoStillwellCoordinate];
[self bambooForestCoordinate];
}

- (void)mainEntrancetoStillwellCoordinate
{
MKPointAnnotation * main = [[MKPointAnnotation alloc]init];
CLLocationCoordinate2D mainLocation;
mainLocation.latitude = 40.831685;
mainLocation.longitude = -73.477453;
[main setCoordinate:mainLocation];
[main setTitle:@"Entrance"];
[main setSubtitle:@"Main"];
[stillwellMapView addAnnotation:main];
}

- (void)bambooForestCoordinate
{
MKPointAnnotation * bambooForest = [[MKPointAnnotation alloc]init];
CLLocationCoordinate2D bambooForestLocation;
bambooForestLocation.latitude = 40.829118;
bambooForestLocation.longitude = -73.466443;
[bambooForest setCoordinate:bambooForestLocation];
[bambooForest setTitle:@"Bamboo Forest"];
[bambooForest setSubtitle:@"Exit to Woodbury"];
[stillwellMapView addAnnotation:bambooForest];
}

-(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation 
(id<MKAnnotation>)annotation
{
MKPinAnnotationView * annView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation      
reuseIdentifier:nil];
UIButton *moreInformationButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
[moreInformationButton addTarget:self action:@selector(moreInformationButtonPressed:)     
forControlEvents:UIControlEventTouchUpInside];
annView.rightCalloutAccessoryView = moreInformationButton;
moreInformationButton.frame = CGRectMake(0, 0, 23, 23);
moreInformationButton.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
moreInformationButton.contentHorizontalAlignment = 
UIControlContentHorizontalAlignmentCenter;


annView.pinColor =MKPinAnnotationColorGreen;
annView.animatesDrop = true;
annView.canShowCallout = TRUE;
return annView;
}

I’m not sure if this is what I need to add, and what needs to go inside here

-(void) moreInformationButtonPressed:(UIButton *)sender
{

}
  • 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-09T07:19:54+00:00Added an answer on June 9, 2026 at 7:19 am

    Write below kind of code:

    -(void) moreInformationButtonPressed:(UIButton *)sender
    {
         OtherViewController *controller = [[OtherViewController alloc]initWithNibName:@"OtherViewController" bundle:nil];
         [self.navigationController pushViewController:controller animated:YES];
         [controller release];      
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently making an app that will control and make use of the
Here is the use case: I am making an app that will email HTML
I'm making an app that has more options than will easily fit into a
I am making an app that will play sound on events but I can't
I'm making an app that will be installed and run on multiple computers, my
I am making an app that will download a zip archive from a location,
i'm making app that the main page include TableView but i want when i
I am making a web app that will process large files (1gb+). While the
I am working on making an application that will store information, and for user
I am making a fitness app that will save your weight, reps, and sets

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.