• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

私下协商协议

用户头像
it1352
帮助1

问题说明

有没有办法隐藏来自最终用户的协议符合?我将尝试详细描述我想要的。我有类让我们称之为 EndUserClass ,它符合一些协议,让我们说 HiddenClassDelegate 和我想从最终用户隐藏的协议。代码如下所示:

Is there any way to hide protocol conforming from an end user? I'll try to describe in details what I want. I have class let's call it EndUserClass which conforms some protocol let's say HiddenClassDelegate and this protocol I'd like to hide from end user. The code looks like as it follows:

@interface EndUserClass : NSObject  <HiddenClassDelegate>
{
  // .....
}   

@end

并且我想使用以下声明保持相同的功能:

and I want to keep the same functionality with the following declaration:

@interface EndUserClass : NSObject  
{
  // .....
}   

@end

有没有办法私下符合协议?我知道我可以在类声明中跳过委托,但它给出了我不想要的编译器警告

Is there any way to conform the protocol privately? I know that I can skip delegate in class declaration but it gives compiler warning which I don't want to have

正确答案

#1

通过在实现文件中声明自定义类类别来实现:

You can do that by declaring custom class category in implementation file:

// .m file
@interface EndUserClass() <HiddenClassDelegate>

@end

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /reply/detail/tanhcfkjgk
系列文章
更多 icon
同类精品
更多 icon
继续加载