macOS/iOS API解説

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

目次

cachesBezierPath

INDEX>AppKit>NSBezier

このオブジェクトは画像をキャッシュするかを返します

Objective-C

Swift


解説

このオブジェクトは画像をキャッシュするかを返します。
キャッシュする場合はYESを返します。
そうでなければNOを返します。

返り値

( BOOL )

キャッシュするYES/NO

引数

フレームワーク

ApplicationKit

クラス

NSBezierPath

使用可能

10.0

参照

- setCachesBezierPath:

例文

Objective-C

Swift

#import "MyView.h"

@implementation MyView

//NSViewのサブクラス MyViewのDrawRectに上書き
-(void)drawRect:(NSRect)rect
{

NSBezierPath *thePath1 = [NSBezierPath bezierPath];
[thePath1 setWindingRule:NSEvenOddWindingRule];

[thePath1 moveToPoint:NSMakePoint(20,20)];

[thePath1 appendBezierPathWithOvalInRect:NSMakeRect(50,50,100,100)];
[thePath1 appendBezierPathWithOvalInRect:NSMakeRect(20,20,80,80)];



[[NSColor redColor] set];
[thePath1 fill];
[thePath1 setCachesBezierPath:YES];

if([thePath1 cachesBezierPath]){
    NSLog(@"YES");
}else{
    NSLog(@"NO");
}

}

@end