title: Case in protected switch
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/7562199/when-converting-a-project-to-use-arc-what-does-switch-case-is-in-protected-scop">When converting a project to use ARC what does &ldquo;switch case is in protected scope&rdquo; mean?</a>  </p>
  </blockquote>
  
  
  
  <p>Got the following xcode:
  But when i try to put something in case 1 (or empty) it's giving me an error? </p>
  
  <p>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..</p>
  
  <pre><code>- (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:&amp;error];
  
              break;
  
          case 1:
              NSLog(@"1");    
  
  
  
  
  
  
              break;
  
  
  
  
  
  
      }
  
      {
  
  
  
          self.EKController.title = [self.EKList objectAtIndex:[indexPath row]];
  
  
  
  
  
  
      }
  
  }
  
  
  @end
  </code></pre>
  
  <p>But an error:</p>
  
  <p><img src="https://i.stack.imgur.com/D49Iu.png" alt="Error"></p>