macOS/iOS API解説

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

目次

representedObject

セルにセットしたオブジェクトを返します

解説

セルにセットしたオブジェクトを返します。
プログラマが、一時的にデータを保管するために使うことができます。

返り値

( id )

オブジェクト

引数

フレームワーク

ApplicationKit

クラス

NSCell

Instance Methods

使用可能

10.0

参照

- setRepresentedObject:

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{
[bCell1 setRepresentedObject:@"1st text"];
[bCell2 setRepresentedObject:@"2nd text"];
}

- (IBAction)cellPush:(id)sender
{
//[sender setTitle:[sender representedObject]];
[bCell1 setTitle:[bCell1 representedObject]];
[bCell2 setTitle:[bCell2 representedObject]];
}

@end