Remove @“” from NSString or typecast NSString into variable name

后端 未结 4 424
星月不相逢
星月不相逢 2021-01-25 08:56

I read a NSString from file and then I want to #define this as a UIColor so I can quickly change color\'s.

I want something to work like so:

#define GRAY         


        
4条回答
  •  走了就别回头了
    2021-01-25 09:22

    When you say 'read from file the string : @"GRAY"' do you mean at application run time? if so, then you cannot use #define(s), which are happening at compile time.

提交回复
热议问题