objective c - UILabel taking a long time to render non-english NSAttributedString -


i have uilabel attached uiscrollview. label getting attributed text .rtf(rich text file). code i'm using achieve is:

    string =     [nsattributedstring.alloc      initwithfileurl:[ nsbundle.mainbundle urlforresource:@"filename" withextension:@"rtf"  ]      options:nil      documentattributes:nil      error:null      ]; 

i passing "string"(attributedstring) uilabel

[self.label setattributedtext:string]; self.label.numberoflines = 0; self.label.textalignment = nstextalignmentcenter; self.label.font = [self.label.font fontwithsize:(long)fontsize]; 

this takes place in viewdidload.

my problem takes long time process line: [self.label setattributedtext:string]; switching 1 view view can take seconds.

furthermore, when try change font of self.label takes long time well.

i know problem uilabel processing attributedstring i'm not sure why , how fix it.

important note: the easy answer use uitextview, don't want because scrolling long non-english text in uitextview choppy , slow. users have complained , after research i've concluded uilabel in scrollview way achieve smooth scrolling application.


Comments