Build a list of constants variable from other constants

前端 未结 3 1162
长情又很酷
长情又很酷 2021-01-18 15:27

I\'ve just read all of objective-c global constants variables Q&A but I found them inappropriate to my problem.

I need a list of variable like t

3条回答
  •  悲&欢浪女
    2021-01-18 16:10

    I don't have access to a MAC now ... can you just try this..

    in .h

    NSString *baseURLString;
    extern NSString *const baseURL;
    

    in .m

    baseURLString= @"http://example.org";
    NSString *const baseURL= [NSString stringWithFormat:"%@", baseURL];
    

    I am not sure of this will work..

    And also have you seen this answer at SO ... it has all the approaches I know of... Constants in Objective-C

提交回复
热议问题