Objective-c中的协议和接口有什么区别? [英] What is the difference between a protocol and a interface in Objective-c?

查看:107
本文介绍了Objective-c中的协议和接口有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对协议和界面之间的区别感到困惑?他们似乎都在做同样的事情?

I am confused about what the difference is between a protocol and an interface? They both seem to be doing the same thing?

它是否像C#中的抽象一样,你需要实现它?

Is it like abstract in C# in that you are required to implement it?

推荐答案

Objective-C中的协议与java中的接口相同,如果这就是你的意思

a protocol in Objective-C is the same as an interface in java, if thats what you mean

这篇关于Objective-c中的协议和接口有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆