ios - NSMutableattributed string not working for substring -


-(nsmutableattributedstring *)getattributedstringforstring:(nsstring *)totalstring filtertext:(nsstring *)filtertext font:(uifont *)titlefont backgroundcolor:(uicolor *)bcolor foregroundcolor:(uicolor *)fcolor {     nsmutableattributedstring *attributedstring = nil;     nsdictionary *filtertextattribute = @{nsbackgroundcolorattributename:bcolor, nsforegroundcolorattributename:fcolor, nsfontattributename: titlefont};     attributedstring = [[nsmutableattributedstring alloc] initwithstring:totalstring];     [attributedstring beginediting];     [attributedstring setattributes:filtertextattribute range:[totalstring rangeofstring:filtertext options:nscaseinsensitivesearch]];     [attributedstring endediting];      return attributedstring; } 

i applying nsmutableattributedstring filtertext in totalstring if filtertext totalstring above setattributes working otherwise not working substrings


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -