macOS/iOS API解説

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

目次

subscriptRange:

指定した範囲の文字を下付きにします
-(void)subscriptRange:(NSRange)aRange:

解説

指定した範囲の文字を下付きにします。
aRangeがレシーバの範囲を越えればNSRangeExceptionを起こします。

返り値

( void )

なし

引数

( NSRange )aRange

範囲

フレームワーク

ApplicationKit

クラス

NSMutableAttributedString Additions

Instance Methods

使用可能

10.0

参照

- superscriptRange:
- unscriptRange:

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{
NSMutableAttributedString *maStr =[[[NSMutableAttributedString alloc] initWithString:@"AttributedString" attributes:nil] autorelease];
//スタイル指定
[maStr subscriptRange:NSMakeRange(2,5)];
        
[myOutlet setAttributedStringValue:maStr];

}

@end