I. Multi-threaded security scenarios
1. Use a sync lock, but it affects performance
2. With Nslock, is also the lock mechanism
3. Using the dispatch queue, in parallel queue, combined with dispatch_barrier, ensure that the data operation of the concurrent queue is executed independently. --refer to the 52 efficient cocoa programming method
Summary: The third approach is optimal, but rarely used. Of course, serial queues are also available, but parallel queues are more efficient. Also, for a single example of the wording: it is best to use dispatch_once.
Two. Processing of picture Fillet
1. Use layer, but this affects performance
2. Use a box with rounded corners
Of course there may be a better way to ask for guidance ...
Three. Talk about your view of block
I want to hear such an open question, you must be ignorant.
Can be answered from block's data structure.
Four. Does the notification of a child thread callback the main thread?
On which thread to post, which thread responds, regardless of the thread registering the listener. Of course, if you specify on which thread you are registering for monitoring, then which thread will respond.
Five. What do I need to be aware of when defining a library or framework?
1. Avoid namespace collisions with prefixes, including class names, global variables, etc.
2. Try to use immutable objects,
3. Use a clear and coordinated naming method
4. Prefix the private method with a different public method
5: Comment Your header file
6. Initializing parameters
Five. Map deviation resolution
Using a corrective database, or interface, for the moment, I didn't think of a better way.
Reference: http://southpeak.github.io/blog/2015/03/14/nsnotificationyu-duo-xian-cheng/
http://blog.csdn.net/mad1989/article/details/10034251
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
First edition of IOS Weekly