Skip to content

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

Merged
merged 6 commits into from
Apr 28, 2016
Merged

Basic implementations of NSAttributedString #334

merged 6 commits into from
Apr 28, 2016

Conversation

eyeplum
Copy link
Contributor

@eyeplum eyeplum commented Apr 19, 2016

Different from #297, this time I'm trying to implement the NSAttributedString to be a is-a relationship to CFAttributedString.

@eyeplum eyeplum changed the title Implement basic initializers of NSAttributedString Basic implementations of NSAttributedString Apr 19, 2016

public class NSAttributedString : NSObject, NSCopying, NSMutableCopying, NSSecureCoding {

private let _cfinfo = _CFInfo(typeID: CFAttributedStringGetTypeID())
private let _string: NSString
Copy link
Contributor Author

@eyeplum eyeplum Apr 19, 2016

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.

Copy link
Contributor

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?

Copy link
Contributor Author

@eyeplum eyeplum Apr 19, 2016

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.

@parkera
Copy link
Contributor

parkera commented Apr 28, 2016

Thanks!

@parkera parkera merged commit 4cd5eb7 into swiftlang:master Apr 28, 2016
@eyeplum eyeplum deleted the attributedstring_isa branch April 29, 2016 04:06
atrick pushed a commit to atrick/swift-corelibs-foundation that referenced this pull request Jan 12, 2021
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants