在 Xcode 中像在 Eclipse 中一样“添加未实现的方法”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10332689/
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 00:06:23  来源:igfitidea点击:

"Add unimplemented methods" in Xcode like in Eclipse

javaiphoneobjective-cxcodeeclipse

提问by Yves

I'm looking for a shortcut or any possibility to add unimplemented Methods like I use it everytime in Eclipse.

我正在寻找一种快捷方式或任何可能性来添加未实现的方法,就像我每次在 Eclipse 中使用它一样。

What I mean is if I declare a method in my .h file like:

我的意思是,如果我在 .h 文件中声明一个方法,例如:

#pragma mark Getter
-(NSDate *)date;
-(unsigned int)number;
-(double)longerNumber;

and after this declaration I can go into my implementation .m file import this interface and press some combination or get an advice where I can click on to implement these methods automatically.

在这个声明之后,我可以进入我的实现 .m 文件导入这个接口并按一些组合或获取建议,我可以点击自动实现这些方法。

Does somebody know something about that possibility or another fast workflow?

有人知道这种可能性或其他快速工作流程吗?

Thanks in advance yves

提前致谢

回答by Krishnabhadra

I don't think it is possible in xcode. You can post an enhancement request here..

我认为在 xcode 中是不可能的。您可以在此处发布增强请求。

You can just type "dash" then "space" and start typing the method name that you want to override. Now push Esc, you will get a list of all possible methods with that string you type. Atleast that reduce the pain of typing full method syntax.

您可以只输入“破折号”,然后输入“空格”,然后开始输入要覆盖的方法名称。现在按 Esc,您将获得包含您键入的字符串的所有可能方法的列表。至少可以减少输入完整方法语法的痛苦。

enter image description here

在此处输入图片说明

Thismacrumours thread might be a good read..

这个macrumours 线程可能是一个很好的阅读..