Objective-C静态分析工具 - Xcode插件?

时间:2022-09-07 07:53:56

Are there any tools out there for Objective-C / Xcode? Something that can do one or more of the following:

Objective-C / Xcode有什么工具吗?可以执行以下一项或多项操作的内容:

  • Detect unused imports
  • 检测未使用的导入
  • Auto-synthesize properties
  • 自动合成属性
  • Autogenerate dealloc method from retained properties
  • 从保留的属性中自动生成dealloc方法
  • Provide method stubs for interface
  • 为接口提供方法存根

4 个解决方案

#1


1  

-Detect unused imports

- 检测未使用的导入

Not sure of anything that checks for dead imports.

不确定检查死亡进口的任何东西。

-Auto-synthesize properties -Autogenerate dealloc method from retained properties

- 自动合成属性 - 从保留属性中自动生成dealloc方法

User Scripts work quite well to do this inside Xcode, you can also use a program like Acessorizer as mentioned but it pastes something onto the clipboard for you to paste.

用户脚本在Xcode中可以很好地完成这项工作,你也可以像上面提到的那样使用像Acessorizer这样的程序,但是它会粘贴到剪贴板上以供你粘贴。

-Provide method stubs for interface

- 提供接口的方法存根

type "init" just after @implementation, and type Control-. (period).

在@implementation之后键入“init”,然后键入Control-。 (期)。

These are user macros (not scripts), and you can easily define your own. Note they have placeholders that you can use tab to jump to the bits to fill in.

这些是用户宏(不是脚本),您可以轻松定义自己的宏。请注意,它们具有占位符,您可以使用Tab跳转到要填充的位。

#2


1  

You want to look at Kevin Callahan's Accessorizer, which can do several of the things you request and more. The Google Toolbox for Mac also includes an Xcode plugin that can remove whitespace and a few other things.

你想看看Kevin Callahan的Accessorizer,它可以做你要求的几件事以及更多。 Google Toolbox for Mac还包含一个Xcode插件,可以删除空白和其他一些内容。

#3


0  

You could probably do something with AppleScript or another scripting language, called via AppleScript, to operate on method or header files.

您可以使用AppleScript或其他脚本语言(通过AppleScript调用)对方法或头文件进行操作。

#4


0  

If you want static analysis, Clang is built in to all recent releases. None of what you've described has anything to do with static analysis, however.

如果您想要静态分析,Clang内置于所有最新版本中。但是,您所描述的内容与静态分析无关。

#1


1  

-Detect unused imports

- 检测未使用的导入

Not sure of anything that checks for dead imports.

不确定检查死亡进口的任何东西。

-Auto-synthesize properties -Autogenerate dealloc method from retained properties

- 自动合成属性 - 从保留属性中自动生成dealloc方法

User Scripts work quite well to do this inside Xcode, you can also use a program like Acessorizer as mentioned but it pastes something onto the clipboard for you to paste.

用户脚本在Xcode中可以很好地完成这项工作,你也可以像上面提到的那样使用像Acessorizer这样的程序,但是它会粘贴到剪贴板上以供你粘贴。

-Provide method stubs for interface

- 提供接口的方法存根

type "init" just after @implementation, and type Control-. (period).

在@implementation之后键入“init”,然后键入Control-。 (期)。

These are user macros (not scripts), and you can easily define your own. Note they have placeholders that you can use tab to jump to the bits to fill in.

这些是用户宏(不是脚本),您可以轻松定义自己的宏。请注意,它们具有占位符,您可以使用Tab跳转到要填充的位。

#2


1  

You want to look at Kevin Callahan's Accessorizer, which can do several of the things you request and more. The Google Toolbox for Mac also includes an Xcode plugin that can remove whitespace and a few other things.

你想看看Kevin Callahan的Accessorizer,它可以做你要求的几件事以及更多。 Google Toolbox for Mac还包含一个Xcode插件,可以删除空白和其他一些内容。

#3


0  

You could probably do something with AppleScript or another scripting language, called via AppleScript, to operate on method or header files.

您可以使用AppleScript或其他脚本语言(通过AppleScript调用)对方法或头文件进行操作。

#4


0  

If you want static analysis, Clang is built in to all recent releases. None of what you've described has anything to do with static analysis, however.

如果您想要静态分析,Clang内置于所有最新版本中。但是,您所描述的内容与静态分析无关。