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 { //.. ...
随机推荐
- Linux的sleep()和usleep()
1.sleep和usleep都是linux中的程序挂起函数.只是时间的单位不一样. 2. sleep的基本单位是s(秒),也可以用m(分).h(小时). 例: sleep 1 : 挂起1秒 sleep ...
- Spark技术内幕: Task向Executor提交的源码解析
在上文<Spark技术内幕:Stage划分及提交源码分析>中,我们分析了Stage的生成和提交.但是Stage的提交,只是DAGScheduler完成了对DAG的划分,生成了一个计算拓扑, ...
- RecyclerView下拉刷新上拉加载(二)
listview下拉刷新上拉加载扩展(一) http://blog.csdn.net/baiyuliang2013/article/details/50252561 listview下拉刷新上拉加载扩 ...
- Android初级教程人品计算器
先看布局: main_activity.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/andr ...
- 1025. PAT Ranking (25)
题目如下: Programming Ability Test (PAT) is organized by the College of Computer Science and Technology ...
- Cocos2D旋转炮塔到指定角度(三)
到目前为止都很美好! 但是却有一点奇怪,因为炮塔一下子跳转到指定位置去射击,并不是平滑的跟随触摸去转动到指定位置.你可以修复这个问题,但是这需要略微一点的重构(refactoring). 首先打开He ...
- 我眼中的Linux设备树(三 属性)
三 属性(property)device_type = "memory"就是一个属性,等号前边是属性,后边是值.节点是一个逻辑上相对独立的实体,属性是用来描述节点特性的,根据需要一 ...
- 在maven中开发Spring需要的jar依赖
在maven中开发Spring需要的jar依赖 <properties> <spring.version>4.0.6.RELEASE</spring.version> ...
- outlook邮箱邮件与企业邮箱同步(outlook本地文件夹邮件,web邮箱里没有)
用惯了outlook2010, 问题:今天将邮件放到自定义文件夹后,发现在web邮箱中看不到邮件了.不能同步到企业邮箱. 解决忙了一天,才知道是账户类型问题,pop3类型,只下载不上传.所以outlo ...
- Linux IPC实践(9) --System V共享内存
共享内存API #include <sys/ipc.h> #include <sys/shm.h> int shmget(key_t key, size_t size, int ...