ios - How does a delegate work in objective-C? -


  1. Does anyone know where I can find a good explanation / tutorial how and how an application representative Objective
  2. I have not been taken into consideration for the representatives in both of those books, and I understand them very well to understand their power and function correctly.

In doubt, check!

Actually, delegation is a way to allow objects to contact each other with each other, without maintaining strong reliance among them, as this design of your application is less flexible. Instead of controlling objects, they can be one representative who send messages (or representative), and whatever the delegates do, to respond to this message and to do the work, and then mango On the other hand, return some other object.

The delegation is also a better option for subclasses. Instead of changing the way to behave in other things, or instead of creating their own custom class to pass them, the delegation allows objects to send messages to their representatives so that the sub Do not make any minor changes in making class other items.

Of course, the main disadvantage of the delegation is that what are the usefulness of Apple engineers in available representative methods and depend on the normal implementation of which they expect people to b What can you get, however, as Quinn Taylor pointed out, this is typical for the coca framework and does not apply in all situations.

If the delegation is an option over sub-clinging, then take it, because it is a very clean way to manage your code and interaction between objects.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -