nsstring - MutableAttributedString concatenation -
i have tried concatenate attributed string different properties,but not reflecting changes,here code
//white color nsmutableattributedstring *attributedstring2 = [[nsmutableattributedstring alloc] initwithdata:[[nsstring stringwithformat:@"%@",readingpartcntnt] datausingencoding:nsunicodestringencoding] options:@{ nsdocumenttypedocumentattribute: nshtmltextdocumenttype } documentattributes:nil error:nil]; [attributedstring2 addattribute:nsforegroundcolorattributename value:[uicolor whitecolor] range:nsmakerange(0, attributedstring2.length)]; [attributedstring2 addattribute:nsfontattributename value:font range:nsmakerange(0, attributedstring2.length)]; //blue color nsmutableattributedstring *attributedstring3 = [[nsmutableattributedstring alloc] initwithdata:[[nsstring stringwithformat:@"%@",readingfootcntnt] datausingencoding:nsunicodestringencoding] options:@{ nsdocumenttypedocumentattribute: nshtmltextdocumenttype } documentattributes:nil error:nil]; [attributedstring3 addattribute:nsforegroundcolorattributename value:[uicolor colorwithred:(154.0/255.0) green:(224.0/255.0) blue:(250.0/255.0) alpha:1.0] range:nsmakerange(0, attributedstring3.length)]; [attributedstring3 addattribute:nsfontattributename value:font range:nsmakerange(0, attributedstring3.length)]; //uitextview readingcontent.attributedtext = [nsmutableattributedstring attributedstringwithattachment:attributedstring2,attributedstring3];
i want concatenate both attributedstring2 attributedstring3 readingcontent.what change required in code?please me resolve
Comments
Post a Comment