rulerAttributesInRange:
指定した範囲のルーラ属性を返します
-(NSDictionary *)rulerAttributesInRange:(NSRange)range:
解説
指定した範囲のルーラ属性を返します。
返り値
( NSDictionary * )
辞書
引数
( NSRange )range
範囲
フレームワーク
ApplicationKit
クラス
NSAttributedStringAdditions
Instance Methods
使用可能
10.1
参照
- fontAttributesInRange:
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender {//開けるファイル拡張子の配列 NSArray *fileTypes = [ NSArray arrayWithObject : @"rtf" ]; //OpenPanelを作る NSOpenPanel *opPanel = [ NSOpenPanel openPanel ]; NSAttributedString *aString; //OpenPanelの結果のボタン番号 int opRet; NSDictionary *dic; //OpenPanelでファイル選択 opRet = [ opPanel runModalForDirectory : NSHomeDirectory() //どこのディレクトリを出すか file : @"Documents" //どのどのファイルを選択しておくか types : fileTypes ];//選べるファイルタイプ if ( opRet == NSOKButton ) { // OPENPanelのボタンがOKなら aString = [[NSAttributedString allocWithZone:[self zone]] initWithPath:[opPanel filename] documentAttributes:NULL]; [myOutlet toggleRuler:nil]; dic = [aString rulerAttributesInRange:NSMakeRange(0,10)]; NSLog([dic description]); } } @end