String Constant as a Localized String

前端 未结 6 2043
深忆病人
深忆病人 2021-02-13 18:14

I would like to localize my constants. Constants are defined and declared the usual way:

extern NSString * const kStringName;

NSString * const kStringName = @\"         


        
6条回答
  •  南方客
    南方客 (楼主)
    2021-02-13 18:49

    Can't you just localize your constant when you need to display it?

    [[NSBundle mainBundle] localizedStringForKey:kStringName 
                                           value:kStringName 
                                           table:nil]
    

提交回复
热议问题