#pragma 标记未显示在 Xcode 4.0 的方法中 [英] #pragma mark not showing in methods in Xcode 4.0

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

问题描述

在 Xcode 4.0 版中,我注意到方法中的 #pragma 标记不再显示在跳转栏中.唯一显示的#pragma 标记是方法之间的标记.

In Xcode Version 4.0 I notice that #pragma marks within methods are no longer showing up in the Jump Bar. The only #pragma marks that are showing up are those that are between methods.

我使用这些 #pragma 标记可以轻松快速地组织和获取出现在我的 tableview 不同部分中的信息,我真的很想恢复该功能.

I was using these #pragma marks to make it easy to quickly organize and get to information that appears in different sections of my tableviews and I would really like to get that functionality back.

有谁知道如何让他们再次出现?

Anyone know how to get them to appear again?

推荐答案

我也遇到了这个问题.在第一个方法之前添加的 pragma 标记不会显示.例如,这将不起作用:

I'm also experiencing this problem. A pragma mark added before the first method will not show up. For example, this will not work:

@implementation RandomClass

#pragma mark - Getter Methods

- (void) firstMethod
{
}

@end

在第一种方法出现之前,这里有一些快速的变通方法来标记编译指示.您可以在它之前添加一个空块,也可以将 pragma 标记放在块本身内.

Here are some quick-dirty workarounds to make the pragma mark before the first method show up. You can add an empty block before it or you can just put the pragma mark inside the block itself.

使用空块:

@implementation RandomClass
{}
#pragma mark - Getter Methods

- (void) firstMethod
{
}

@end

在空块本身内添加编译指示:

@implementation RandomClass
{
#pragma mark - Getter Methods
}

- (void) firstMethod
{
}

@end

它看起来不太漂亮,但很管用.我希望这会有所帮助.

It doesn't look too pretty but it works. I hope that helps.

这篇关于#pragma 标记未显示在 Xcode 4.0 的方法中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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