這可能很容易,但我不能縫隙搞清楚 - 可能是晚了。我有一個簡單的程序,將NSTextView
中的文本保存爲rtf
。保存文本本身效果很好,我只是無法弄清楚如何獲取屬性來標記。屬性沒有與文件保存
代碼:
NSAttributedString *saveString = [[NSAttributedString alloc]
initWithString:[textView string]];
NSData *writeResults = [saveString
RTFFromRange:NSMakeRange:(0, [saveString length])
doumentAttributes:?? ];
[writeResults writeToURL:[panel URL] atomically: YES];
我知道我需要爲documentAttributes
的NSDictionary
,所以我如何才能從有何看法?
我錯過了什麼?
沒有屬性給你沒有在屬性字符串中設置任何(甚至不知道你調用的是什麼字符串方法)。 – Droppy 2014-10-18 09:30:34