ios - Can we create subdivisions of #pragma mark in Objective C? -
we using #pragma
make code more readable, accurate , separated groups.
for example: i'm using #pragma
below:
//--------------------------------------------------------------- #pragma mark #pragma mark prefrences methods //---------------------------------------------------------------
however there wondering, can create sub section of #pragma
in can divide in 1 more layer.
like have lots of related methods below:
you can see these preference related methods , can not divide other #pragma
.
just want know whether there constants in xcode #subpragma
or can divide #pragma
?
possibility:
category:
#pragma mark #pragma mark level 1
the 2 lines (two #pragma mark
) create "separator".
subcategory:
#pragma mark — sublevel
the single line (one #pragma mark
) give title. used —
change "indent" of text.
sample:
#pragma mark #pragma mark life cycle -(id)init { self = [super init]; if (self) { } return self; } #pragma mark #pragma mark category 1 -(void)methodcategory1{} #pragma mark — subcat1 -(void)method1cat1subcat1{} -(void)method2cat1subcat1{} #pragma mark — subcat2 -(void)method1cat1subcat2{} -(void)method2cat1subcat2{} #pragma mark #pragma mark category 2 -(void)methodcategory2{} #pragma mark — subcat1 -(void)method1cat2subcat1{} -(void)method2cat2subcat1{} #pragma mark — subcat2 -(void)method1cat2subcat2{} -(void)method2cat2subcat2{}
Comments
Post a Comment