Tworzę przycisk i ustawiam tytuł jako "Kliknij tutaj". Po naciśnięciu tego przycisku chcę uzyskać tytuł tego przycisku i zalogować go. Oto mój kod, gdzie się mylę?Uzyskiwanie tytułu UIButton w module obsługi zdarzeń
-(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.
}
bardzo dobre okrzyki –