macOS/iOS API解説

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

目次

isEmpty

レシーバーが、空であるどうか返します

解説

レシーバーが、空であるどうか返します。

返り値

( BOOL )

空YES/NO

引数

フレームワーク

ApplicationKit

クラス

NSBezierPath

Instance Methods

使用可能

10.0

参照

例文

#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 lineToPoint:NSMakePoint(120,120)];
[[NSColor redColor] set];
[thePath1 stroke];

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

}

@end