Core Text w treści UITableviewCell nakłada się i powtarza i nakłada na inne komórki

Używam Core Text do dodawania tekstu do treści UITableviewCell, ale arabska treść wydaje się nakładać na siebie i powtarzać się, gdy przewijam i nakładam na inne komórki.

Używam także innych elementów na stronie, które wyglądają dobrze i nie powtarzają się. Just the Core Text wydaje się powtarzać.

Nie rozumiem dlaczego.

Oto mój kod:

     - (CTFontRef)newCustomFontWithName:(NSString *)aFontName
                            ofType:(NSString *)type
                        attributes:(NSDictionary *)attributes {
    NSString *fontPath = [[NSBundle mainBundle] pathForResource:aFontName ofType:type];

    NSData *data = [[NSData alloc] initWithContentsOfFile:fontPath];
    CGDataProviderRef fontProvider = CGDataProviderCreateWithCFData((__bridge CFDataRef)data);


    CGFontRef cgFont = CGFontCreateWithDataProvider(fontProvider);
    CGDataProviderRelease(fontProvider);

    CTFontDescriptorRef fontDescriptor = CTFontDescriptorCreateWithAttributes((__bridge CFDictionaryRef)attributes);
    CTFontRef font = CTFontCreateWithGraphicsFont(cgFont, 0, NULL, fontDescriptor);
    CFRelease(fontDescriptor);
    CGFontRelease(cgFont);
    return font;
}

- (CATextLayer *)customCATextLayer:(NSString *)textString {
    NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:
                                [NSNumber numberWithFloat:24.f], (NSString *)kCTFontSizeAttribute,
                                [NSNumber numberWithInt:1], (NSString *)kCTLigatureAttributeName,
                                nil];

    CTFontRef font = [self newCustomFontWithName:@"me_quranKer6"
                                          ofType:@"ttf"
                                      attributes:attributes];

    CATextLayer *normalTextLayer = [[CATextLayer alloc] init];
    normalTextLayer.font = font;
    normalTextLayer.string = textString;
    normalTextLayer.wrapped = YES;
    normalTextLayer.foregroundColor = [[UIColor blackColor] CGColor];
    normalTextLayer.fontSize = 24.f;
    normalTextLayer.alignmentMode = kCAAlignmentCenter;
    normalTextLayer.frame = CGRectMake(0.f, 10.f, 320.f, 32.f);

    CFRelease(font);
    return normalTextLayer;
}



- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    QuranVersesViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"verseCell"];

    Verse *verse = [self.fetchedResultsController objectAtIndexPath:indexPath];

     //English Content starts


    NSMutableAttributedString * englishAttributedString;
    if (!englishAttributedString)
        englishAttributedString = [[NSMutableAttributedString alloc] initWithString:@""];

    NSMutableAttributedString * englishSubtitleAttributedString;


    NSMutableAttributedString * englishVerseAttributedString;
    if (!englishVerseAttributedString)
        englishVerseAttributedString = [[NSMutableAttributedString alloc] initWithString:verse.english_version];

    NSMutableAttributedString * englishFootnoteAttributedString;
    if (!englishFootnoteAttributedString)
        englishFootnoteAttributedString = [[NSMutableAttributedString alloc] init];



    NSString *englishString = @"";

    if(verse.subtitle.length>0)
    {
        NSMutableParagraphStyle *mutParaStyle=[[NSMutableParagraphStyle alloc] init];

        [mutParaStyle setAlignment:NSTextAlignmentCenter];




        englishSubtitleAttributedString = [[NSMutableAttributedString alloc] initWithString:verse.subtitle];

    [englishSubtitleAttributedString addAttributes:[NSDictionary dictionaryWithObject:mutParaStyle
                                                       forKey:NSParagraphStyleAttributeName]
                     range:NSMakeRange(0,[[englishSubtitleAttributedString string] length])];
        [englishAttributedString appendAttributedString:englishSubtitleAttributedString];

        [englishAttributedString addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"Arial" size:30] range:NSRangeFromString(verse.subtitle)];
        NSLog(@"text us %@", englishAttributedString);

    }// englishString = [englishString stringByAppendingString:[NSString stringWithFormat:@"%@\n\n", verse.subtitle]];

    [englishAttributedString appendAttributedString:englishVerseAttributedString];

    englishString = [englishString stringByAppendingString:[NSString stringWithFormat:@"[%@:%@] %@\n",  verse.whichSura.sura_no, verse.verse_no, verse.english_version]];

    if(verse.footnote.length>0)
        englishString = [englishString stringByAppendingString: [NSString stringWithFormat:@"\n%@\n", verse.footnote]];


englishString =  [englishString stringByReplacingOccurrencesOfString:@"“" withString:@"\"" ];
  englishString =   [englishString stringByReplacingOccurrencesOfString:@"_" withString:@"\n" ];


  cell.quranVerseEnglishTextView.attributedText = englishAttributedString;
  [cell.quranVerseEnglishTextView autoResizeWithMaxWidth:MAX_TEXT_WIDTH];


    cell.quranVerseEnglishTextView.backgroundColor = [UIColor clearColor];
  //English Content starts


//Arabic Content

    CATextLayer *arabicTextLayer = [self customCATextLayer:verse.arabic_version];
    [cell.arabicView.layer addSublayer:arabicTextLayer];







    return cell;

}

questionAnswers(2)

yourAnswerToTheQuestion