macOS/iOS API解説

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

目次

indexOfTickMarkAtPoint:

指定した点に最も近いチックマークの番号を返します
-(int)indexOfTickMarkAtPoint:(NSPoint)point:

解説

指定した点に最も近いチックマークの番号を返します。
バウンディングボックスの中で、点がなければNSNotFoundを返します。

返り値

( int )

整数値

引数

( NSPoint )point

位置

フレームワーク

ApplicationKit

クラス

NSSliderCell

Instance Methods

使用可能

10.0

参照

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
    {
    int ret;
        ret = [slider indexOfTickMarkAtPoint:NSMakePoint(10,10)];
        if (ret==NSNotFound){
            NSLog(@"NSNotFound");
        }else{
            NSLog([NSString stringWithFormat:@"%d",ret]);
        }
}
   
   
- (IBAction)slide:(id)sender
{

}
@end