-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Basic implementations of NSAttributedString #334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Start implementing the NSAttributedString as is-a CFAttributedString, this commit contains some basic initializer implementations
|
||
public class NSAttributedString : NSObject, NSCopying, NSMutableCopying, NSSecureCoding { | ||
|
||
private let _cfinfo = _CFInfo(typeID: CFAttributedStringGetTypeID()) | ||
private let _string: NSString |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to use private let _string: String
here, but encountered EXC_BAD_ACCESS at CFString function calls like CFStringGetLength
( inside the CF_SWIFT_FUNCDISPATCHV
macro ).
I couldn't figure out why, but found out that with a NSString
, everything seemed to be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think https://bugs.swift.org/browse/SR-1129 could be related?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SR-1129 looks like a compile time error, what I encountered is a runtime error.
So, maybe they are not related.
My guess is that this is a memory related issue.
Thanks! |
…ang#334) * Replaces two logs since those don't result in response messages anymore * Adds a func for sending messages synchronously, to get the two messages out before fatalError
Different from #297, this time I'm trying to implement the NSAttributedString to be a is-a relationship to CFAttributedString.