deleteCharactersInRange:
変更可能属性付き文字列の指定した範囲を削除します
-(void)deleteCharactersInRange:(NSRange)aRange:
解説
変更可能属性付き文字列の指定した範囲を削除します
範囲がレシーバを越える場合はNSRangeExceptionを起こします。
返り値
( void )
なし
引数
( NSRange )aRange
範囲
フレームワーク
Foundation
クラス
NSMutableAttributedString
Instance Methods
使用可能
10.0
参照
- replaceCharactersInRange:withAttributedString:
- replaceCharactersInRange:withString:
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSMutableAttributedString *maStr =[[[NSMutableAttributedString alloc] initWithString:@"AttributedString" attributes:[self boldFontAttributes]] autorelease]; [maStr deleteCharactersInRange:NSMakeRange(2,5)]; [myOutlet setAttributedStringValue:maStr]; } - (NSDictionary*)boldFontAttributes { return [NSDictionary dictionaryWithObject: [NSFont boldSystemFontOfSize:[NSFont systemFontSize]] forKey:NSFontAttributeName]; } @end