I am studying the development of ObjC and iOS. All the components that I use in my applications are created programmatically (views, buttons, labels, etc.).
Here is my code
...
UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[self.btn addTarget:self
action:@selector(someAction:)
forControlEvents:UIControlEventTouchDown];
....
-(void)someAction
{
logic
}
I notice that I can use void instead of IBAction as the return type of the selector. Is this the right approach? Could there be pitfalls?
objlv source
share