How do you define a protocol?



How do you define a protocol?..

Answer / Manoj Kumar Tiwari

"To define a protocol in Objective-C, you use the `@protocol` directive. Here's an example of defining a simple protocol:n```n@protocol MyProtocoln// Optional methods and properties go heren@endn```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Objective-C Interview Questions

What is single inheritance in objective-c?

1 Answers  


Which language does apple use?

1 Answers  


What is the difference between underscore and self (i.e self.xx and _xx) ?

1 Answers  


Explain what are the attributes of category?

1 Answers  


What is difference between nsstring and nsmutablestring?

1 Answers  


How messaging works in objective-c?

1 Answers  


What is the use of objective c?

1 Answers  


How to create uibutton programmatically in objective c?

1 Answers  


What's the difference between a thread safe and a thread unsafe function?

1 Answers  


What are the types of ios binaries you can create using xcode?

1 Answers  


How to use objective c file in swift?

1 Answers  


Can you retain delegates?

1 Answers  


Categories