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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T02:39:34+00:00 2026-05-21T02:39:34+00:00

yes but i have a problem i have created a controller that inherits from

  • 0

yes but i have a problem i have created a controller that inherits from uitableviewcontroller and i have written a code that calls action sheet on barbutton item on toolbar but it gives me an error.

mapType = [[[UIBarButtonItem alloc]initWithTitle:@"MAP TYPE" style:UIBarButtonItemStyleBordered target:self action:@selector(chooseMapType:)]autorelease]; 
self.toolbarItems = [NSArray arrayWithObjects:space, addButton, removeButton,mapType, nil]; [self.navigationController.view addSubview:self.navigationController.toolbar]; 

    - (IBAction)chooseMapType:(id)sender {

    UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"Map Type"  delegate:self   cancelButtonTitle:@"Cancel"     destructiveButtonTitle:nil otherButtonTitles:kMapTypeRegular, kMapTypeSatellite, nil];
 [sheet showFromToolbar:navigationController.toolbar];
 [sheet release];
 }

this is my method which i have passed to my selector .

- (void)actionSheet:(UIActionSheet*)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
 NSString *clickedButtonTitle = [actionSheet buttonTitleAtIndex:buttonIndex];
 if ([clickedButtonTitle isEqualToString:kMapTypeRegular])
 [[self mapView] setMapType:MKMapTypeStandard];
 else if ([clickedButtonTitle isEqualToString:kMapTypeSatellite])
 [[self mapView] setMapType:MKMapTypeSatellite];
 } 

this i my action sheet method but it is not getting called and giving me an error that -[UIActionSheet _presentSheetFromView:above:], /SourceCache/UIKit_Sim/UIKit-1447.6.4/UIActionSheet. – Abhishek Mar 24 at 8:59

  • 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-21T02:39:35+00:00Added an answer on May 21, 2026 at 2:39 am

    Please ensure, your chooseMapType function is properly connected with UIBarButtonItem in your XIB file.

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

Sidebar

Related Questions

(Yes I know I can call Java code from Scala; but that is pointless;
I have the following code (Yes I know it's quite long winded, but I
(Before anyone says anything Yes this was homework but i have already turned it
Crappy title, yes. But I honestly have no idea what this particular line of
Yes, I have searched and tried many techniques, but nothing seems to work. Here
I have completed the assignment (yes it is for a programming class), but I
I have a problem that's starting to drive me crazy.. I've narrowed my problem
I am having an issue pushing my view controller from a tableview that was
I have a problem with the splitviewcontroller. I have the code below and when
The Problem I created a multi step form, and yes the javascript and all

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.