insertTextContainer:atIndex:
レイアウトマネージャーの指定した位置にテキストコンテナを挿入します
-(void)insertTextContainer:(NSTextContainer *)aTextContainer: atIndex:(unsigned)index:
解説
レイアウトマネージャーの指定した位置(index)にテキストコンテナ(aTextContainer)を挿入します。
返り値
( void )
なし
引数
( NSTextContainer * )aTextContainer
テキストコンテナ
( unsigned )index
挿入する位置
フレームワーク
ApplicationKit
クラス
NSLayoutManager
Instance Methods
使用可能
10.0
参照
- addTextContainer:
- removeTextContainerAtIndex:
- textContainers
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { //myOutletはTextView NSLayoutManager *layM1; NSTextContainer *textContainer1 = [[NSTextContainer allocWithZone:NULL] initWithContainerSize:NSMakeSize(1.0e6, 1.0e6)]; NSTextContainer *textContainer2 = [[NSTextContainer allocWithZone:NULL] initWithContainerSize:NSMakeSize(1.0e6, 1.0e6)]; layM1 = [myOutlet1 layoutManager]; [layM1 addTextContainer:textContainer1]; [layM1 insertTextContainer:textContainer2 atIndex:1]; NSLog([[layM1 textContainers] description]); } @end