macOS/iOS API解説

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

目次

pointValue

NSPointを返します

解説

NSPointを返します。

返り値

( NSPoint )

位置

引数

クラス

NSValue

Instance Methods

使用可能

10.0

参照

- rectValue
- sizeValue

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{

//NSPointを渡す場合
NSValue *value = [NSValue valueWithPoint:NSMakePoint(1.23456,7.89012)];

NSPoint bufferPoint;
[value getValue:&bufferPoint];
NSLog(@"---%f,%f",bufferPoint.x,bufferPoint.y);
NSLog(@"---%f,%f",[value pointValue].x,[value pointValue].y);

}

@end