setRepresentedObject:
セルにオブジェクトをセットします
-(void)setRepresentedObject:(id)anObject:
解説
セルにオブジェクトをセットします。
プログラマが、一時的にデータを保管するために使うことができます。
返り値
( void )
なし
引数
( id )anObject
オブジェクト
フレームワーク
ApplicationKit
クラス
NSCell
Instance Methods
使用可能
10.0
参照
例文
#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