如何在 Xcode 7.2 中创建类别?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36380855/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 08:41:19  来源:igfitidea点击:

How to create a category in Xcode 7.2?

objective-cxcodecocoa-touchobjective-c-category

提问by Strikecounter2

How do I create a category to an existing Cocoa Touch Class for objective-c in Xcode 7.2? I've been looking for an hour but couldn't find anything helpful.

如何在 Xcode 7.2 中为 Objective-c 创建现有 Cocoa Touch 类的类别?我一直在寻找一个小时,但找不到任何有用的东西。

回答by rob mayoff

  1. File > New > File…
  2. iOS > Source
  3. Objective-C File
  4. Next
  5. File Type: Category
  1. 文件 > 新建 > 文件...
  2. iOS > 源码
  3. Objective-C 文件
  4. 下一个
  5. 文件类型:类别

Example:

例子:

creating a category file

创建类别文件