0402 the difference between notice and agent
- The agent is one-to-one, can only be called implementation of the Protocol in the method, the object as the implementation of the method to execute the method
- Notifications are many-to-many and are distributed through notification hubs
- Notifications are removed in a timely manner and may receive multiple notifications if not removed in time, as if events in C # are registered multiple times. It is also possible (the notification center will not keep the notified object) that the notified object has been destroyed, but the notification center still retains this notification to continue the notification causing a wild pointer error, and the app may crash.
- At the same time the addition and removal is easy and kvo mixed together, as long as the attention Addobserver and removeobserver the time not to choose Forkeypath.
is a code instance:
Remove Notification: Note KVO
Keyboard notifications
- Uidevice Some of the notifications, such as:
Handling of text boxes
Question 1: In the text box Uitextview, the cursor is stuck to the leftmost side by default, and you need to leave some distance to the cursor, what should I do now?
A: Uitextview does not have a uiedgeinset attribute, so it cannot be set by setting an inner margin. Uitextview has a Leftview member, and Leftviewmodel for uitextfieldviewmodelalways, so you can put a width without background color uiview on it.
Question 2: Since the text box appears, the keyboard pop-up in the lower right corner of the text logo will be changed, how to change it?
A: Each text box Uitextview has a Returnkey property, where it can be set. If you want to change to the problem you want to need other knowledge preparation. Note: Uitextview also has a property of Auto-enbale Retuen key, which determines the usability of the button in the lower right corner of the keyboard.
Question 3: How to listen for a text box Uitextview carriage return Event
A: Use a proxy, such as:
Set keyboard pop-up QQ Chat window background color method
The keyboard pop-up and the height of the collection should refer to this QQ chat 06-Keyboard processing
IOS Advanced Sixth Day (0402)