Questions tagged [addtarget]

addTarget method is used to assign actions to UIControl elements in IOS.

92 questions
-1
votes
2 answers

Fixing "use of unresolved identifier 'addTarget'" while adding func to button click event

I've created a UIButton programmatically as shown below: let buttons: [UIButton] = [UIButton(frame: CGRect(x: 0, y: 0, width: 50, height: 50))]; Now if I try to add a function to it programmatically like this: [buttons[0] addTarget:self…
user11140694
-1
votes
1 answer

'unrecognized selector sent to instance' for UIPageControl ValueChanged event

I am trying to programmatically use addTarget() to add ValueChanged Event for UIPageControl object in mainView. var pageControls = mainView.subviews.filter { $0 is UIPageControl } as [UIPageControl] for p in pageControls { println("\(p.tag)" …
Adaoli
  • 27
  • 1
  • 5
1 2 3 4 5 6
7