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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:02:20+00:00 2026-05-31T14:02:20+00:00

I am actually trying to display a new controller of type UIViewController MKMapViewDelegate in

  • 0

I am actually trying to display a new controller of type UIViewController MKMapViewDelegate
in the function didSelectRowAtIndexPath.
I have a tableview in a controller and when I click on a cell of this tableview i want to display the new controller of type UIViewController MKMapViewDelegate.

My code is the following:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath     *)indexPath
{
// Navigation logic may go here. Create and push another view controller.
UIViewController *mapviewtest=[[MapStation alloc]initWithNibName:@"MapStation"   bundle:nil];
[self.navigationController pushViewController:mapviewtest animated:YES];

//Station *station = nil;
//station = [self.listStation objectAtIndex:indexPath.row];
}

The problem is when i click on any cell of the tableview the program quit with a breakpoint on the line:

UIViewController *mapviewtest=[[MapStation alloc]initWithNibName:@"MapStation"   bundle:nil];

I don’t know why it does that and how to resolve this mistake. Maybe do you know an other way to do it(without using pushviewController function).

Waiting for your answers guys 😉

Sincerely

Quentin

  • 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-31T14:02:22+00:00Added an answer on May 31, 2026 at 2:02 pm

    It sounds like you need to change the way you set up the application a little. Follow the design below and you should be fine. Your major problem sounds like you are not creating a navigation controller which you must do.

    Inside the App Delegate:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        // Create the Window
        self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    
        // Create RootViewController (i.e. Table View)
        RootViewController *rootViewController = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:nil];
    
        // Create the Navigation Controller
        UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:rootViewController];
    
        // Make the Navigation Controller the RootViewController
        self.window.rootViewController = navigationController;
    
        // Display the Window
        [self.window makeKeyAndVisible];
    
        return YES;
    }
    

    Inside the RootViewController:

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
        // Create MapStation
        MapStation *mapviewtest = [[MapStation alloc] initWithNibName:@"MapStation" bundle:nil];
    
        // Push MapStation on to the self.navigationController (i.e you in the RootViewController class right
        // which is a navigation controller so this will work.
        [self.navigationController pushViewController:mapviewtest animated:YES];
    
        // mapviewtest is retained by the navigationController so release it
        [mapviewtest release];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Edit--@Uri correctly pointed out that this was an abuse of annotations; trying to actually
Im trying to display this listview, but I keep getting a: 07-17 21:14:22.233: ERROR/AndroidRuntime(349):
I am trying to display results of a custom post type on my main
hi everyone i am new to iphone development. Actually i am trying with some
I am actually trying to start a process for winzip and zip a folder.
What I'm actually trying to do is put a WebKitView into a ScreenSaver (which
I am actually trying to change the color index for the first word with
is there similar syntax to php's $$variable in python? what I am actually trying
Actually I am trying to move some box alternatively with in another box. I
Actually I'm trying to implement an ontouchlistener into my android (1.5) application. therefore i

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.