Xcode - 使用 #pragma 标记 [英] Xcode - Using #pragma mark

查看:39
本文介绍了Xcode - 使用 #pragma 标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很确定这不是重复的.你使用#pragma 标记吗?我见过多种方式,哪个是正确的?

I'm pretty sure this isn't a duplicate. Do you use #pragma mark? I've seen multiple ways, which is correct?

#pragma mark -
#pragma mark === Actions ===
#pragma mark -

#pragma mark -
#pragma mark === Actions ===

#pragma mark - === Actions ===

#pragma mark Actions

你是怎么做的?你建议怎么分?您通常将您的部分命名为什么,例如,视图控制器?

What is the way you do it? How do you suggest dividing it up? What do you normally name your sections, for say, a view controller?

推荐答案

没有正确"的方式,它是注解,所以你如何使用它是一个编码风格问题.

There is no "Correct" way, it is annotation, so how you use it is a coding style issue.

话虽如此,我愿意:

#pragma mark -
#pragma mark Actions

因为这会导致 Xcode 编辑器中的弹出菜单将标题和方法分组在同一分隔符内.

Because that causes the popup menu in the Xcode editor group the title and the methods inside of the same divider.

这篇关于Xcode - 使用 #pragma 标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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