Framework on iOS not linked against UIKit which tries to add a CTFont to a NSDictionary doesn't compile
| Originator: | ktam64 | ||
| Number: | rdar://20113785 | Date Originated: | March 10 2015 |
| Status: | Closed | Resolved: | Yes |
| Product: | Xcode | Product Version: | 6.3 beta 2 |
| Classification: | Bug | Reproducible: | Yes |
Summary:
This is a regression compared to Xcode 6.1.1
I'm developing a framework on iOS and OS X and I'm not linking against UIKit on the iOS side. I am using CoreText to do text drawing and when I try and add CTFont to a NSDictionary the compiler complains that the CTFontRef is bridged with UIFont but that the objective-c class UIFont doesn't exist.
Steps to Reproduce:
1. Make a framework for iOS using Xcode 6.3 beta 2.
2. Do not link that framework against UIKit, do not import UIKit from any sources.
3. Create a CTFontRef CoreText font.
4. Attempt to add the font to a NSDictionary.
5. ** Get a compile error** Because CTFontRef is bridged with UIFont but the UIFont objective-c class doesn't exist.
CTFontRef font = <...>
NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithCapacity:0];
[dict setObject:(__bridge id)(font)
forKey:(__bridge NSString *)(kCTFontAttributeName)];
CF object of type 'CTFontRef' (aka 'const struct __CTFont *') is bridged to 'UIFont', which is not an Objective-C class
Expected Results:
I expect to be able to add a CTFontRef object to a NSDictionary
Actual Results:
I get a compile error when I try and the font.
Version:
iOS 8
Notes:
Configuration:
64 Bit framework.
Attachments:
Fixed in Xcode 7 beta, iOS SDK.
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!