I have an NSPanel in my program. It has an NSTextField that I set when the panel is initialized. The text has hyperlinked text in it that the user should be able to click on to navigate to a web site and to send an e-mail for support. At one time this worked but now it has stopped.
I load a simple .html file from the project’s resources into NSData from the project’s resources:
Then I set the IBOutlet NSTextField *aString text with
The text in the NSTextField is the text I want. The hyperlinked text is highlighted as if the user can click on it but when the cursor is moved over it the cursor doesn’t change and it don’t respond to mouse Clicks. Setting the field to enabled either in Interface Builder or in the code to initialize the text field doesn’t help.
This worked for years but now Apple has changed something and it stopped working. What do I have to do to make this work again?
I load a simple .html file from the project’s resources into NSData from the project’s resources:
Code:
NSString * pathToFile = [[NSBundle mainBundle] pathForResource: @"myFile" ofType: @"html"];
NSData * htmlData = [NSData dataWithContentsOfFile: pathToFile];
Then I set the IBOutlet NSTextField *aString text with
Code:
NSAttributedString *htmlAttributedString = [[NSAttributedString alloc] initWithHTML: htmlData documentAttributes: NULL];
[aString setAttributedStringValue: htmlAttributedString];
The text in the NSTextField is the text I want. The hyperlinked text is highlighted as if the user can click on it but when the cursor is moved over it the cursor doesn’t change and it don’t respond to mouse Clicks. Setting the field to enabled either in Interface Builder or in the code to initialize the text field doesn’t help.
This worked for years but now Apple has changed something and it stopped working. What do I have to do to make this work again?
Last edited: