If you set the value of the constant in the .m, it is not visible by other translation units that only include the .h file. The value of the constant must be known at compile time to be able to be used in a case within a switch.
意思是:当使用extern在.h中声明常量,在.m中给该常量赋值,意味着外部不能知道该常量的值,只能使用,而switch中case的值是需要在编译阶段就要知道case的具体常量值,但是这个是extern无法做到的。