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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:30:07+00:00 2026-06-12T10:30:07+00:00

I am writing an app where I have a mapview displayed. Now I want

  • 0

I am writing an app where I have a mapview displayed. Now I want to give the user the option to change the MKMapType from standard to hybrid.

In oder to do that I created a segue to another view controller containing a switch to set the Map Type. The transition is modal using a partial curl. To access the value of the switch, I introduced a BOOL which is called fotoMode in AppDelegate. If this variable is set to YES (and if the switch is set to ON) then I’d like to redraw the map.

- (IBAction) FotoModusSwitchChanged:(UISwitch *)sender 
{
 AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];    
if(sender.isOn)
 {
    appDelegate.fotoMode=YES;
 }
 else 
 {
    appDelegate.fotoMode=NO;
 }
}

I have included the following lines of code in VieWillAppear, ViewDidAppear, ViewDidLoad, ViewWillLayoutSubviews of the view controller for the Map View but it does not work:

AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];    
if (appDelegate.fotoMode) {
    [self.MapOutlet setMapType:MKMapTypeHybrid];
}
else
{
    [self.MapOutlet setMapType:MKMapTypeStandard];
}

Any idea what I am doing wrong? Thanks.

PS: Setting the MKMapType manually to Hybrid or Standard works…

  • 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-12T10:30:09+00:00Added an answer on June 12, 2026 at 10:30 am

    your code seems right to me but I think you’re having problem with declaration of the “fotoMode”.

    Make sure that under your Appdelegate.h file you define your BOOL

    @property(nonatomic,assign) BOOL fotoMode;

    if you don’t declare your BOOL right then you wont’ be able to set and get the right value.

    Hope helps…

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

Sidebar

Related Questions

I'm writing an app that monitors the user's location. I have a CLLocationManager object
I'm writing an app and I want one of my activities to have a
I am writing an app which should have the following use case: User clicks
I am writing an App where we want to have several pages in a
Well, I have a app writing in Flex AS4. Now I have a component
I'm writing a sales app where items have a :savings attribute that ranges from
I am writing a winforms app in which a user selects an item from
I'm writing a MVVM app and have started putting in a few animations. I
I'm writing an app where I have a BorderLayout for the entire page. In
I am writing an app which needs to have both the traditional form of

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.