我很难理解到底出了什么问题。我有一个NSWindowController和一个NSWindow和一个NSTextView。我想将NSWindowController 和 NSWindow (以及它的所有控件)存档到一个文件中。
然后,我想解压缩相同的NSWindowController和NSWindow以及文件中的所有视图。但是苹果公司的文档上说:
Note: Although the NSWindow class inherits the NSCoding protocol from NSResponder, the class does not support coding. Legacy
在我的应用程序中,我想在NSTextView中显示弹出窗口,并需要将NSTextView中选定矩形的坐标转换为屏幕坐标。我尝试过以下代码:
NSWindow* viewWindow = [self window];
NSRect rect = [self firstRectForCharacterRange:[self selectedRange]];
rect = [[self superview] convertRect:rect toView:nil]; //converting to NSClipView coordinate system
rect = [viewWindow con
我发现了这个小片段,它允许用户从NSTextView中的文本创建链接:
-(void)setHyperlinkWithTextView:(NSTextView*)inTextView
{
// create the attributed string
NSMutableAttributedString *string = [[NSMutableAttributedString alloc] init];
// create the url and use it for our attributed string
NSURL* url = [NSURL URLW