kCTParagraphStyleAttributeName has wrong value

Originator:robert.boehnke
Number:rdar://12354615 Date Originated:23-Sep-2012 12:15 PM
Status:Closed Resolved:Yes
Product: Product Version:6.0 (10A403)
Classification:Serious Bug Reproducible:Always
 
Summary:

In iOS 6.0 (10A403), kCTParagraphStyleAttributeName has the incorrect value of @"NSParagraphStyle" when it should be @"CTParagraphStyle".

Steps to Reproduce:

Assigning a CTParagraphStyleRef to an NSMutableAttributedString using kCTParagraphStyleAttributeName like for example so

    CTParagraphStyleRef paragraphStyle = CTParagraphStyleCreate(NULL, 0);

    // As of this writing, `kCTParagraphStyleAttributeName`
    NSDictionary *paragraphAttributes = @{
        ((NSString *) kCTParagraphStyleAttributeName): ((__bridge id) paragraphStyle)
    };

    NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:@"Hello World"];
    [string addAttributes:paragraphAttributes range:NSMakeRange(0, 11)];

    [string drawAtPoint:CGPointZero];

Expected Results:

The string is being drawn

Actual Results:

An exception is thrown:
-[__NSCFType lineBreakMode]: unrecognized selector sent to instance 0x1f547090

Regression:

Notes:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!