Questions tagged [target-action]

Target-action is a design pattern from Apple in which an object holds the information necessary to send a message to another object when an event occurs.

The Target-action design pattern is implemented in UIControl () in iOS / UIKit and NSControl () in macOS / AppKit.

Target Action Design Pattern

66 questions
0
votes
1 answer

Disabling view animation during a segue (or vice versa)

I have a rightBarButtonItem that slides up a view from the bottom of the screen like a UIActionSheet, and everything works fine except when I press a button that pushes a UIViewController and the rightBarButton almost at the same time, the two will…
funct7
  • 3,407
  • 2
  • 27
  • 33
0
votes
1 answer

How to add view with buttons (target-action) to a scroll view

I have created a custom UIViewController with its view in a .xib file created in Interface Builder. The view looks like this: The view has a UIButton with a target-action pair. The action is a method in the view's view controller. I want to add…
user3124010
0
votes
2 answers

How to copy paste code without unnecessary target action link on XCode?

When I create a new project and copy paste code from the old project, the target action link between the pasted method and storyboard in the old project will be added. But I don't want the old action target link. If I click on the target action…
allenlinli
  • 2,066
  • 3
  • 27
  • 49
0
votes
3 answers

UIBarButtonItem target-action does not invoke

- (void)viewDidLoad { [super viewDidLoad]; //Load the image UIImage *buttonImage = [UIImage imageNamed:@"1.png"]; //create the button and assign the image UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; …
coolhongly
  • 53
  • 3
  • 10
0
votes
1 answer

UIControl - addTarget: action: forControlEvents doesn't call the method inside selector

I have problem with adding target/action method to my app. Here's my code: -(void)printInConsole { NSLog(@"2"); } -(void)createGCButton { UIButton * LButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; LButton.frame = CGRectMake(200,…
Klemen
  • 2,144
  • 2
  • 23
  • 31
0
votes
1 answer

Getting selected row from a button in a view based tableview

I have a view based tableview with a button which displays a popover: How would I go about setting the selected to the row that holds the pressed button. I'm using core data, with an array controller. I plan to have the tableview in the popover…
1 2 3 4
5