macOS/iOS API解説

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

目次

titleRectForBounds:

タイトルの範囲を返します
-(NSRect)titleRectForBounds:(NSRect)theRect:

解説

タイトルの範囲を返します。セルがテキストタイプセルでなければ、何もしません。

返り値

( NSRect )

範囲

引数

( NSRect )theRect

範囲

フレームワーク

ApplicationKit

クラス

NSCell

Instance Methods

使用可能

10.0

参照

- imageRectForBounds:

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{
NSRect rec = [bCell1 titleRectForBounds:NSMakeRect(0,0,100,100)];
NSLog([NSString stringWithFormat:@"x=%.1f,y=%.1fw=%.1f,h=%.1f",rec.origin.x,rec.origin.y,rec.size.width,rec.size.height]);
}

@end