When converting a project to use ARC what does "switch case is in protected scope" mean? When converting a project to use ARC what does "switch case is in protected scope" mean? xcode xcode

When converting a project to use ARC what does "switch case is in protected scope" mean?


Surround each case itself with braces {}. That should fix the issue (it did for me in one of my projects).


Hard to be sure without looking at the code, but it probably means there's some variable declaration going on inside the switch and the compiler can't tell if there's a clear path to the required dealloc point.


There are 2 easy ways to solve this issue:

  • You are probably declaring variables. Move the declaration of the variablesoutside the switch statement
  • Put the whole case block in between curly brackets {}

The compiler can not calculate the code line when the variables are to be released.Causing this error.