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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:59:39+00:00 2026-05-27T10:59:39+00:00

Possible Duplicate: When converting a project to use ARC what does “switch case is

  • 0

Possible Duplicate:
When converting a project to use ARC what does “switch case is in protected scope” mean?

Got the following xcode:
But when i try to put something in case 1 (or empty) it’s giving me an error?

Weird problem because i dont know what a protected switch is and how i should fix it. Does anyone has a solution or clue to fix this? Weird..

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

    switch(indexPath.row) {
        case 0:
            NSLog(@"0");

            //create instance of EKEventStore
            EKEventStore *eventStore = [[EKEventStore alloc] init];

            //creating instance of EKEvent
            EKEvent *event  = [EKEvent eventWithEventStore:eventStore];

            //setting the appropriate properties of the new event
            event.title     = @"Woow";

            //event.startDate = [[NSDate alloc] init];



            NSDateComponents *myDate2 = [[NSDateComponents alloc] init];
            [myDate2 setDay:13];
            [myDate2 setMonth:12];
            [myDate2 setYear:2011];
            [myDate2 setHour:00];
            [myDate2 setMinute:34];

            event.startDate = [[NSCalendar currentCalendar] dateFromComponents:myDate2];

            event.endDate   = [[NSDate alloc] initWithTimeInterval:3600 sinceDate:event.startDate];
            event.location = @"game2";
            event.notes = @" game";

            event.alarms = [NSArray arrayWithObject:[EKAlarm alarmWithAbsoluteDate:event.startDate]];

            [event setCalendar:[eventStore defaultCalendarForNewEvents]];
            NSError *error;
            [eventStore saveEvent:event span:EKSpanThisEvent error:&error];

            break;

        case 1:
            NSLog(@"1");    






            break;






    }

    {



        self.EKController.title = [self.EKList objectAtIndex:[indexPath row]];






    }

}


@end

But an error:

Error

  • 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-27T10:59:39+00:00Added an answer on May 27, 2026 at 10:59 am

    You should wrap each switch statement with {} braces. For example:

    switch (someInt) {
        case 0:
        {
            NSLog(@"Case 0");
        }
        break;
        case 1:
        {
            NSLog(@"Case 1");
        }
        break;
    }
    

    This has been answered already here by the way – When converting a project to use ARC what does "switch case is in protected scope" mean?

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

Sidebar

Related Questions

Possible Duplicate: How does the Google Did you mean? Algorithm work? Suppose you have
Possible Duplicate: Converting Raw HTTP Request into HTTPWebRequest Object I've got a custom HTTP
Possible Duplicate: Converting from Mercurial to Subversion Hi. Does anyone know of a relatively
Possible Duplicate: Converting an ISO 8601 timestamp into an NSDate: How does one deal
Possible Duplicate: How to test a “.xap” file on a Windows Phone 7 device?
Possible Duplicate: Converting XML to JSON using Python? I am importing an XML feed
Possible Duplicate: Converting XML to JSON using Python? I'm doing some work on App
Possible Duplicate: Why not use tables for layout in HTML? Under what conditions should
Possible Duplicate: Converting string in C# I want to camelize a string, for example:
Possible Duplicate: Converting string to MySQL timestamp format in php Given a date in

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.