What do you mean by delegate? Can a user retain delegates?

devquora
devquora

Posted On: Feb 22, 2018

 

A delegate is an object, which acts on behalf of, or in coordination or sync with, another object when the other/second object encounters an event during program execution.
Delegates can be retained if the user wants to. If the user declares it to be retained (which means the delegate will be influential in ARC) it’ll be retained.
Generally, the norm is not to retain the delegates because they are already retained elsewhere and more importantly, the user can avoid retaining cycles by opting not to retain them.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    C++ Interview Questions

    Explain what is OOP?

    Object-oriented programming (OOP) is a type of computer programming, also more commonly known as software design, in wh..

    C++ Interview Questions

    What is the difference between #import and #include in C++?

    The statement #include is used in C++ to include the source file or import the header files containing definitions of f..

    C++ Interview Questions

    What is ‘this’ pointer?

    The ‘this’ pointer is passed as a hidden argument to all the non-static member method calls and is available as a l..