The buttons on the UIView jump to a controller UIViewController, And the uiviewcontroller jumps

Source: Internet
Author: User

The buttons on the UIView jump to a controller UIViewController, And the uiviewcontroller jumps

I now have a UIControllerView in which addView has a UIView. When I click UIView, I go to another UIControllerView and press the return button above the navigation bar to return the first UIControllerView, how to Use pushViewController in that UIView

Send messages in UIView

[[Nsicationcenter center defacenter center] postNotificationName: @ "push" object: nil];

 

Receive messages in the parent class controller and

[[Nsicationcenter center defacenter center] addObserver: self selector: @ selector (pushOne) name: @ "push" object: nil];

-(Void) pushOne

{

YYCSettingController * setting = [[YYCSettingController alloc] init];

[Self. navigationController pushViewController: setting animated: YES];

}

 

Send message
[[Nsicationicationcenter defacenter center]
PostNotificationName: @ "chuandi" object: self];
The action of writing an action to receive a message
[[Nsicationcenter center defacenter center] addObserver: self
Selector: @ selector (action)
Name: @ "chuandi" object: nil];
For example, if you trigger an event in a subclass and send the message to the parent class, the action in the parent class is pushed to another subclass.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.