NotificationCenter As a tool for developing .NET applications that are available on both OS X and iOS that reduce dependency in car heaters (Loose Coupling) of Object are contained within in car heaters the application by sending messages to the system. If there are other methods in the Object in car heaters or Object Watch the occurrence of the message. The data will be submitted with the announcement. Then processed Or said simply, if we look at the shop and noodles during the application design is developed. When customers to sit in Guay Tiew. With staff to get food items Then shouted orders (shipped Notification) Cook noodles with storefront. (Who are watching all the food is), it starts to cook, shop, cook noodles in car heaters according to the employee during the food items that come with the table number in car heaters on the bill comes. If we make Other customers in the store Steward Food employees (Compared with all the objects in the application) do not have any reaction. They also make their own activities continue as normal. With all employees receive food items shipped out. Because people are not waiting for the message. Next, when the cook, cook noodles unit successfully, it will send a message out that Guay Tiew finished with a bowl of noodles on the table and the order number. Of course, we all cook send out news. Food delivery staff will gradually watched the birth of it, anyway, when this happens, it will bring food to the table to the customer (the data is sent along with the message is processed) framework.
Yes, send Notification will be working one-to-one (to-one) alone. If, however, the message can be spread out to any object registered with. NotificationCenter To watch the emergence of text to it. The work will be shown below.
The picture that is at the center of it all work. NSNotficationCenter Start Workflow Notification in car heaters when a message is sent to a reminder. (Marseille Notification Center) in car heaters For example, in Figure in car heaters 1 is the Price Changed Notification was made and sent to a notification in car heaters class. NSNotificationCenter which NSNotificationCenter Also serves to spread the message to Object in car heaters Registration receive it. The picture was distributed to 3 (this might be in the same or separate multiple Object Object Relationship) is AppDelegate, Update UI and Update Database, which will serve the 3 different in car heaters companies. Such adjustments are defined using a local application. Modifying the content displayed Or calculate and update the information in the database, etc. Register and Posting.
From Figure 1, we see that the Notification that form into 3 major sections is registered with the Notification Center. (Notification Center) in order to know if there is a warning message in car heaters in the system. Object to call the method from working in car heaters any alarm messages. To other parts Of applications through NSNotificationCenter. To get new information from the warning message to the processor as needed. in car heaters When an application is running until the conditions prescribed. The information submitted with the notification in car heaters message does not need to put up with it all. Get text alerts processed. Notifications usually the developers choose to send or not send Object of NSNotification. To the methods of the work. (If you want to send a value to change or spread out) or not.
From the foregoing, it Register with Notification Center is to identify the needs surveillance occurs either use the Object Surveillance Surveillance messages generated by any method from Object -addObserver: selector: name: object: the NSNotificationCenter. By where to add the code to register Notification should be made for everyone. An application that can run applications. For example,
In the example above code lines 4-10 Add method updateNewPrice: Notification for the method by which this value is the parameter to Notification Center alerts are sent based on the parameters in car heaters of the method selector in car heaters -addObserver: selector: name: object. :
From the top of the alert. When an application is processed until the conditions set out as a warning to others. Within an application, the registration await the emergence of Notification in car heaters to run either as desired. And between classes used Alert Use a class Register with Notification Center No need to be known at all. Likewise, a message is sent by the called method. -updateInformation: completion: the name of the controller. SLInformationSyncronisationBoardViewController The information is sent by the method. -postNotificationName: object: userInfo:
When data is updated through the method. -updateInformation: completion: the internal sent out by attaching information to improve it. (Information) comes in the form of a NSDictionary key is "priceChangedNotification" This message will be sent to you. NSNotificationCenter Already Next to this, it is the duty of notification center will gradually match between the name and the Object Notification sent to that are watching the emergence of the text. Get text alerts processed.
The final step is to remove the information from the processing Notification sent from above to do so. Example of this Notification is sent with the Object of NSNotification. By Bridget's in userInfo parameter if taken -updatenewPrice: In Example 1, we have further developed. End-use
Because it's all text communication.
No comments:
Post a Comment