• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Linebreaks ignored in custom cell
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Linebreaks ignored in custom cell


  • Subject: Linebreaks ignored in custom cell
  • From: Alexander Reichstadt <email@hidden>
  • Date: Fri, 08 Jul 2011 15:00:38 +0200

Hi,

my cell doesn't display newline chars. It returns YES in the wraps-override. I tried all newline chars including the unicode one. Nothing shows. Please, can someone help?

Thanks

- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{


<snip>




    [style setAlignment:NSLeftTextAlignment];
    attr = [NSDictionary dictionaryWithObjectsAndKeys:style,NSParagraphStyleAttributeName,topLineFont,NSFontAttributeName,topLineColor,NSForegroundColorAttributeName,nil];
    [displayID drawInRect:bgRectLineAContent withAttributes:attr];

    NSRect lineBodyFrame = cellFrame;
    lineBodyFrame.origin.x = 0;
    lineBodyFrame.size.height -= bgRectLineA.size.height;
    lineBodyFrame.origin.y = cellFrame.origin.y+bgRectLineA.size.height;

    NSMutableString *displayString = [NSMutableString string];
    //    [displayID appendString:[[self objectValue] objectForKey:@"source"]];
    //    [displayID appendString:@" "];
    sortedArray = [NSArray arrayWithArray:[[self objectValue] allKeys]];
    sortedArray = [sortedArray sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)];
    for (NSString *thisOne in sortedArray){
        if ([thisOne length]>6 && [[thisOne substringToIndex:6] isEqualToString:@"qdesc_"]){
            if ([[[self objectValue] objectForKey:thisOne] length]>0){
//                      if ([displayString length]>0)
                    [displayID appendString:@"\r"];
                [displayString appendString:[[self objectValue] objectForKey:thisOne]];
            }

        }
    }

    [style setAlignment:NSLeftTextAlignment];
    attr = [NSDictionary dictionaryWithObjectsAndKeys:style,NSParagraphStyleAttributeName,bodyFont,NSFontAttributeName,topLineColor,NSForegroundColorAttributeName,NSLineBreakByClipping,NSParagraphStyleAttributeName,nil];
    [displayString drawInRect:lineBodyFrame withAttributes:attr];
}

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Linebreaks ignored in custom cell
      • From: Alexander Reichstadt <email@hidden>
  • Prev by Date: Why won't iOS app using MKMapView compile?
  • Next by Date: Re: Why won't iOS app using MKMapView compile?
  • Previous by thread: Re: Why won't iOS app using MKMapView compile?
  • Next by thread: Re: Linebreaks ignored in custom cell
  • Index(es):
    • Date
    • Thread