I am working in xCode on a Mac app. I have a string with HTML in it. I want to convert this to NSAttributedString. I see many references to using initWithData: including the Apple Documentation.
When I enter this code:
[NSAttributedString alloc]initWith
xCode shows no completion for initWithData:
If I copy and paste the complete line from posts I see to accomplish this, I am told that initWithData: does not exist.
Why is this?
Deployment target is :10.10
It all works for me. When I go to the definition of initWithData, I see it's added in a NSAttributedString category declared in AppKit, so make sure you import AppKit and not just Foundation. (This different import is documented on the web page for initWithData:… . This "splitting" of NSAttributedString is necessary because it depends on declarations outside of Foundation.)