macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

RTFDFileWrapperFromRange:documentAttributes:

範囲と文書属性辞書でRTFD書類を作ります
-(NSFileWrapper *)RTFDFileWrapperFromRange:(NSRange)aRange:
          documentAttributes:(NSDictionary *)docAttributes:

解説

範囲と文書属性辞書でRTFD書類を作ります。

返り値

( NSFileWrapper * )

ファイルラッパー

引数

( NSRange )aRange

範囲

( NSDictionary * )docAttributes

文書属性辞書

フレームワーク

ApplicationKit

クラス

NSAttributedStringAdditions

Instance Methods

使用可能

10.1

参照

- RTFFromRange:documentAttributes:
- RTFDFromRange:documentAttributes:

例文

//注意!!!
//testWriteRTFD.rtfdというファイルが警告なしで上書きされます。

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{
    NSAttributedString *aString = [[NSAttributedString alloc] initWithString:@"This document written by method of writeToFile"];

    NSFileWrapper *theWrapper2 ;


  
theWrapper2 = [aString RTFDFileWrapperFromRange:NSMakeRange(0,46) documentAttributes:nil];
NSLog([theWrapper2 className]);

if ([theWrapper2 writeToFile:@"/testWriteRTFD.rtfd" atomically:YES updateFilenames:YES]){
NSLog(@"YES");
}else{
NSLog(@"NO");
}

}

@end