Xcode and #pragma mark
原帖地址:http://macdevelopertips.com/xcode/xcode-and-pragma-mark.html
I’ve started using #pragma mark directives in my code to help with organization as my implementation files grow. #pragma mark is simple to use, for example, insert the following to call out initialization code:
#pragma mark -
#pragma mark Initialization
Once this is in place, the Functions Menu (in the navigation bar) which shows a list of locations within a source file (e.g. definitions of classes, functions and methods) will display a new marker with the label “Initialization.” The code in line 1 will add a line separator inside the Functions Menu, in this example, with the line appearing above the “Initialization” marker.
The figure that follows shows an example of how you might use #pragma mark to divide up various sections of your code.

Two notes:
- You cannot have a space after the “-” in the #pragma mark –
- If your code does not appear as expected (e.g. the separator does not appear), check that ‘Sort list alphabetically’ is not checked in the Code Sense preference settings.
Xcode and #pragma mark的更多相关文章
- android studio: 实现类似于XCode中的#pragma mark的效果
代码行数写多了,想找一个指定的方法真困难,关键有时候记不住方法的名字,用Ctrl+O也不好使,突然想到以前做iOS开发时,XCode里有一个#pragma mark的功能,很好用:在代码中定义这样一个 ...
- 从Objective-C到Swift,你必须会的(一)#pragma mark
在Objective-C里,为了让代码组织的有序也方便用control+6的快捷键在Xcode中查找,所以出现了一个大家都很熟悉的东东.这就是:#prama mark. #pragma mark 但 ...
- 善用#waring,#pragma mark 标记
在项目开发中,我们不可能对着需求一口气将代码都写好.开发过程中肯定遇到诸如需求变动,业务逻辑沟通,运行环境的切换等这些问题.当项目大的时候,如果木有形成统一的代码规范,在项目交接和开发人员沟通上将会带 ...
- #pragma mark指令
1.#pragma mark指令的使用 功能:简单来说就是对代码的分组,方便代码查找和导航用的 它们告诉Xcode编译器,要在编辑器窗格顶部的方法和函数弹出菜单中将代码分隔开.一些类(尤其是一些控制器 ...
- layoutSubviews #pragma mark -
>>>layoutSubviews: layoutSubviews是对sbuviews的重新布局,比如,我们想更新子视图的位置,可以通过调用layoutSubviews方法(不能直接 ...
- pragma mark - 合成图
#pragma mark - 合成图 - (UIImage *)getShareImageShell:(UIImage *)shareImage { if (shareImage) { CGSize ...
- IOS笔记 #pragma mark的用法和作用(方便查找和导航代码)
简单的来说就是为了方便查找和导航代码用的. 下面举例如何快速的定位到我已经标识过的代码. #pragma mark 播放节拍器 - (void) Run:(NSNumber *)tick{ ...
- 李洪强iOS开发之OC[015]#pragma mark的使用
// // main.m // 14 - #pragma mark的使用 // // Created by vic fan on 16/7/10. // Copyright © 2016年 李 ...
- IOS笔记 #pragma mark的用法
简单的来说就是为了方便查找和导航代码用的. 下面举例如何快速的定位到我已经标识过的代码. #pragma mark 播放节拍器 - (void) Run:(NSNumber *)tick { //.. ...
随机推荐
- Android必知必会-带列表的地图POI周边搜索
如果移动端访问不佳,请尝试–> Github版 2016-08-22 更新 注意:在 Activity 代码中的onPoiSearched(PoiResult result, int rCode ...
- Linux--FTP和MAIL服务器
1) FTP协议 FTP(FileTransfer Protocol,文件传输协议)用于管理计算机之间的文件传送.FTP 是Internet 上使用非常广泛的一种通讯协议,它是由支持Intern ...
- mapdb的一些性能测试
jdk1.6,8g,64位,Intel Core i5-4210U CPU @ 1.70GHz 2.40GHz 使用memorydb 100个htreemap,每个htreemap对应50条线程操作, ...
- Centos中git的安装
CentOS的yum源中没有git,只能自己编译安装,现在记录下编译安装的内容,留给自己备忘. 确保已安装了依赖的包 yum install curl yum install curl-deve ...
- EBS的性能调优
metalink Tuning performance on eBusiness suite (Doc ID 744143.1) 这篇文档描述了如何调查电子商务套件的整体性能下降. ...
- 定义范围中的备选方案生成、横向思维、创建WBS、工作包定义、WBS、确认范围过程和实施质量过程的关系、联合应用设计和质量功能展开QFD
- 【一天一道LeetCode】#260. Single Number III
一天一道LeetCode 本系列文章已全部上传至我的github,地址:ZeeCoder's Github 欢迎大家关注我的新浪微博,我的新浪微博 欢迎转载,转载请注明出处 (一)题目 Given a ...
- android studio编译慢的问题
1.修改android studio的使用堆内存,根据自己电脑的内存,尽量设置的大一点,点击help->如下图: 2.接下来设置使用离线gradle构建,一开始就是使用了内置的默认路径gradl ...
- Oracle PL/SQL Articles
我是搬运工....http://www.oracle-base.com/articles/plsql/articles-plsql.php Oracle 8i Oracle 9i Oracle 10g ...
- input驱动12种事件类型Event types的含义
linux2.6 input subsystem中部分相关结构体的分析 最近在做linux2.6的键盘驱动程序的工作,接触到了input subsystem这一概念,现把我对其中相关结构体的理解写出 ...