ios - Get the index of a parameter in a NSLocalizedString -


this nslocalizedstring:

 "your_info" = "%i first number,  %i second , %i third"; 

later on, i'm using string this:

 nsstring *detailstring = [nsstring stringwithformat:nslocalizedstring(@"your_info", nil), firstval, secondval, thirdval]; 

i'm trying find out indexes of variables in order use nsmutableattributedstring highlight them in bold.

i going use rangeofstring, realised there issue if if 2 values same.... there way position in string of variables in other smart way?

if want bold each number in string, @ using enumeratesubstringsinrange:options:usingblock: enumerate each word in string , check if it's numeric (longlongvalue). when find numeric values enumeration block provides range know modify in attributed string.


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -