numberOfColorStops
グラデーションオブジェクトにカラーがいくつセットされているかを返します
解説
グラデーションオブジェクトにカラーがいくつセットされているかを返します。
返り値
( NSInteger )
引数
フレームワーク
ApplicationKit
クラス
NSGradient
使用可能
10.5
参照
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSGradient *gradient = [[NSGradient alloc] initWithColors: [NSArray arrayWithObjects: [NSColor redColor], [NSColor greenColor], [NSColor blueColor], nil ] ]; [theView lockFocus]; [gradient drawInRect: NSMakeRect(0,0,100,100) angle: (CGFloat)30.0 ]; [theView unlockFocus]; NSLog(@"numberOfColorSteps %d",[gradient numberOfColorStops]); } @end