Explain the difference between 'protocol' and 'delegate'?



Explain the difference between 'protocol' and 'delegate'?..

Answer / Mahfooz Alam

In Objective-C, a protocol defines a blueprint of methods that a class should implement to adhere to certain rules or behaviors. It is a way for multiple classes to communicate with each other by following a common interface. On the other hand, a delegate is an object that is appointed to handle specific events or tasks for another object. A delegate typically conforms to a protocol to define the methods it will implement.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Apple iOS Interview Questions

What is libdispatch?

1 Answers  


What design patterns do you use in ios? : IOS Architect

1 Answers  


What is difference between nsnotification and delegate?

1 Answers  


Is it possible to write a program without using nib file

1 Answers  


what is the difference between nonatomic & atomic ? which is thread safe and why

1 Answers  


How to send crash report from device?

1 Answers  


What is @synthesize?

1 Answers  


What are moments and collections?

1 Answers  


Explain the difference between frame and bounds?

1 Answers  


What is gcd in ios swift?

1 Answers  


What does ios stand for in texting?

1 Answers  


What is difference between mvc and mvvm in ios?

1 Answers  


Categories