Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

setDelegate explanation

Tags:

ios

delegates

Hi i am new to iphone developement, can any one explain me why setDelegate is used, where we should use it.

[request setDelegate:sender];

thanks in advance.

like image 971
mac Avatar asked Feb 27 '23 01:02

mac


1 Answers

Delegates are simply a design pattern; there is no special syntax or language support.

A delegate is just an object that another object sends messages to when certain things happen, so that the delegate can handle application-specific details the original object wasn't designed for. It's a way of customizing behavior without subclassing.

like image 73
Malek Avatar answered Mar 12 '23 18:03

Malek