ios - Create IBOutlets and IBActions programmatically -


i want create iboutlets , ibactions in code rather interface builder.

let's i've got button on ui called btndisplay, , method in code called displaymessage. code i'd have write make when btndisplay tapped, displaymessage runs?

the way no outlets give button tag in ib, 128. then:

uibutton *btndisplay = (uibutton *)[self.view viewwithtag:128]; [btndisplay  addtarget:self action:@selector(pressedbtndisplay:) forcontrolevents:uicontroleventtouchupinside]; 

then implement:

- (void) pressedbtndisplay:(id)sender { } 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -