Use of nsnotificationcenter

Source: Internet
Author: User

1. Register nsnotificationcenter and set Association

1 [[nsicationicationcenter defacenter center] addobserver: Self selector: @ selector (getarray :) name: @ "getarray" Object: Nil]; 2 3-(void) getarray :( nsnotification *) anotif4 4 {5 // receives the passed array. The array contains the status Class Object 6 self. statusarr = anotification. object; 7}

2. Message sending (with parameters)

1 // send the temparr array to [[nsnotificationcenter defaultcenter] postnotificationname: @ "getarray" Object: temparr] In the method corresponding to the message whose name is @ "getarray" through the message center;

Supplement: IOS local notification uilocalnotification usage, refer to address-> http://www.cnblogs.com/lan0725/p/3195263.html

Use of nsnotificationcenter

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.