ios - point a String to a list of constants and get the constant value -
i'd know how possible point string list of constants , constant value. have list of hundreds constants declared in .m follow:
nsstring *const onenumber = @"2.58"; nsstring *const twonumber = @"3.58"; nsstring *const threenumber = @"2.72"; // , on...
below have "mystring" value give me same name of 1 of constants:
nsstring *mystring= [[nsstring alloc] initwithformat:@"%@number", mynumber]; //mynumber isequal one,two,three etc...
how can displayed value of number specified in constant in label without use hundreds of if statements?
result.text= [[nsstring alloc]initwithformat:@"%@", ????? ];
thanks answers in advance.
Comments
Post a Comment