生成吸气剂& XCode中的setters [英] Generating getters & setters in XCode

查看:105
本文介绍了生成吸气剂& XCode中的setters的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前使用xcode进行一些c ++开发&我需要生成getter&

I am currently using xcode for some c++ development & I need to generate getters & setters.

我知道的唯一方法是生成getter& Objective C风格的setters

The only way I know is generating getters & setters in Objective C style

这样的东西
- (string)name;
- (void)setName:(string)value;

something like this - (string)name; - (void)setName:(string)value;

我不想要这个;我想要c ++风格生成与实现& 。

I dont want this; I want c++ style generation with implementation & declaration for use in the header files.

任何想法...?

推荐答案

这听起来像是你只是寻找一种方法来减少编写getters / setters(即property / synthesize语句)的麻烦吗?

It sounds like you're just looking for a way to reduce the hassle of writing getters/setters (i.e. property/synthesize statements) all the time right?

有一个免费的,您可以在XCode中使用甚至生成@property和@在突出显示一个我觉得非常有帮助的成员变量后自动综合语句)

There's a free macro you can use in XCode to even generate the @property and @synthesize statements automatically after highlighting a member variable that I find really helpful :)

如果你正在寻找一个更强大的工具,还有另一个付费工具辅助工具,您可能想要签出。

If you're looking for a more robust tool, there's another paid tool called Accessorizer that you might want to check out.

这篇关于生成吸气剂& XCode中的setters的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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