IOS page Jump and Data Transmission

Source: Internet
Author: User

IOS page Jump and Data Transmission

IOS page Jump:

First

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

// Description: Jump to [self. navigationController popViewControllerAnimated: YES] Through NSNavigationBar; // Description: return to the parent view in the subview

Second

UIViewController * control = [[UIViewController alloc] init]; [self presentModalViewController: control animated: YES]; [control release]; // Description: Jump to [self dismissModalViewControllerAnimated through an event: YES]; // Description: return through the event.


Third

[Self. view. window addSubview: otherview]; [self. view removeFromSuperview]

Data transmission:

1) The proxy mode is used for the sub-viewcontroller to design the proxy protocol and define the Protocol interface. The parent viewcontroller implements the Protocol interface to update the relevant data to the parent view when the sub-viewcontroller exits.
2) The parent viewcontroller registers the message sub-viewcontroller to send messages using the message mechanism of ios, which triggers message processing of the parent viewcontroller.

[[Nsicationcenter center defacenter center] addObserver: self selector: @ selector (setData :) name: kNotificationMessage object: nil]; // register the listener, where setData is used to process messages

[[Nsicationcenter center defacenter center] postNotificationName: kNotificationMessage object: self userInfo: infoDict]; // send a message
3) The database is used as the medium for storing data. The sub-viewcontroller saves the status data to the DB, and the parent viewcontroller obtains data from the DB to update the view.
4) use NSDefault storage for ios
5) define global variables in AppDelegate to store intermediate data.

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.