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.
意思是:當(dāng)使用extern在.h中聲明常量硕勿,在.m中給該常量賦值匠题,意味著外部不能知道該常量的值崭放,只能使用晌块,而switch中case的值是需要在編譯階段就要知道case的具體常量值,但是這個是extern無法做到的。