macOS/iOS API解説

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

目次

setParagraphStyle:

別の段落スタイルで段落スタイルをセットします
-(void)setParagraphStyle:(NSParagraphStyle *)aStyle:

解説

別の段落スタイルで段落スタイルをセットします。

返り値

( void )

なし

引数

( NSParagraphStyle * )aStyle

属性スタイル

フレームワーク

ApplicationKit

クラス

NSMutableParagraphStyle

Instance Methods

使用可能

10.0

参照

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{

NSTextTab *tabStop1 = [[NSTextTab alloc] initWithType:NSLeftTabStopType
                                        location:10];
NSTextTab *tabStop2 = [[NSTextTab alloc] initWithType:NSLeftTabStopType
                                        location:20];

NSArray *arr = [NSArray arrayWithObjects:tabStop1,tabStop2,nil];
NSMutableParagraphStyle *pStyle1 = [[NSMutableParagraphStyle alloc] init];
[pStyle1 setTabStops:arr];
NSMutableParagraphStyle *pStyle2 = [[NSMutableParagraphStyle alloc] init];

NSLog([[pStyle1 tabStops] description]);
[pStyle2 setParagraphStyle:pStyle1];
NSLog([[pStyle2 tabStops] description]);
}

@end