-4
-(void)clicketbutton{
UIButton *mybutton = [UIButton buttonWithType:UIButtonTypeCustom];
[mybutton setTitle:@"Click here" forState:UIControlStateNormal];
[mybutton addTarget:self action:@selector(displayvalue:)forControlEvents:UIControlEventTouchUpInside];
}
-(void)displayvalue:(id)sender{
UIButton *resultebutton= [UIButton buttonWithType:UIButtonTypeCustom];
resultebutton=sender;// pls clear here.. my question here , it it possible or not. if possible how ? NSLog(@" The buttontitile is %@ ", [resultebutton.Title] // here also. }
在上面的代碼中,我創建了一個按鈕並將標題設置爲Click here
。當我按下那個按鈕時,我想打印Click here
,我的意思是它的標題。爲此,我的代碼在這裏。選擇器關鍵字
hi arc charbonneau ... Thankyou非常..迴應我.. 我提到我的問題很清楚..請幫助我..這是非常迫切的。 非常感謝你一次 – Raju 2009-05-23 05:01:56