iOS page jump and data transfer

Source: Internet
Author: User

iOS page Jump:

First Kind

[Self.navigationcontroller Pushviewcontroller:subtableviewcontroller Animated:yes];

Description: Jump through Nsnavigationbar [Self.navigationcontroller Popviewcontrolleranimated:yes]; Description: Return to Parent view in child view

The second Kind

Uiviewcontroller *control = [[Uiviewcontroller alloc] init]; [Self Presentmodalviewcontroller:control animated:yes]; [Control release];  Description: Jump through events [self dismissmodalviewcontrolleranimated:yes]; Description: Returned through an event.


Third Kind

[Self.view.window Addsubview:otherview]; [Self.view Removefromsuperview]

Data transfer:

1) Using the proxy mode sub-Viewcontroller Design Agent protocol, define the Protocol interface, the parent Viewcontroller implement the Protocol interface, the implementation of the child Viewcontroller exit when the relevant data updated to the parent view.
2) using the message mechanism of iOS, the parent Viewcontroller registers message sub-viewcontroller to send messages, triggering the parent Viewcontroller message processing.

[[Nsnotificationcenter Defaultcenter] addobserver:self selector: @selector (setData:) name:knotificationmessage object:nil];//register for monitoring, where SetData is used to process messages

[[Nsnotificationcenter Defaultcenter] Postnotificationname:knotificationmessage object:self userInfo:infoDict];// Send Message
3) Using database as the middle of the storage medium, sub-viewcontroller state data into the DB, the parent Viewcontroller from the DB to get the data update view.
4) Nsdefault storage with iOS
5) The storage of intermediate data is implemented by defining global variables in Appdelegate.

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.