I am new to iPhone technology. Please tell me how to add an action for UIButton.
UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect]; btn.frame = CGRectMake(0, 0, 100, 25); btn.backgroundColor = [UIColor clearColor]; [btn setTitle:@"Play" forState:UIControlStateNormal]; [btn addTarget:self action:(buttonClick:) forControlEvents:UIControlEventTouchUpInside]; btn.center = self.center; [self addSubview:btn];
ios objective-c iphone ios4
Ankur
source share