iphone - How to add action to one dynamic button in one UIView Control to move back to UIViewController -


In my application, I created UIViewController and Dynamically created UIView.In that view dynamically created subviews (UIButton and PickerViewController) I want to display the chosen picker view value in a label control in the UIViewController ... how to act on this button to return to UIViewController ...

You can either pass UIViewCOntroller's reference to subview or you can click on the subview Can create fixed-end methods.

Method 1:

// The code below is written in your UIViewController

/ * You should write the implementation of initWithFrame: viewController: in UIVIEW

  CustomUIView * youSubView = [[CustomUIView alloc] initWithFrame: YourFrame view controller: Self]; // The code below is in custom uViv - (id) initWithFrame: (CGRect) Frame view controller: (id) vc {.... UIButton * btn = [UIButton buttonWithType: UIButtonTypeCustom]; [BTN Edit Target: VC Action: Laws for Controlling Events: UIControlEventTouchUpInside]; }  

Method 2:

Create protocol and create a representative in UIView and respond to delegate calls to UIViewController


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -