2

I have written Pragma Mark after @implementation ViewController in .m file.

But Pragma Mark is not display in .m file whenever i have not synthesized any property. Why Xcode is restricting me for doing this ?

Even if other Pragma Marks is displayed. But the Pragma Mark written after @implementation ViewController is not displayed.

If i synthesized any single property after @implementation ViewController, then the Pragma Mark is displayed. I am not getting all this fus.

@implementation ViewController


# pragma  mark View Life cycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}
DipakSonara
  • 2,598
  • 3
  • 29
  • 34

3 Answers3

3

Use in this way:

@implementation MainViewController
{}
#pragma YES
#pragma mark - Second -
Anoop Vaidya
  • 46,283
  • 15
  • 111
  • 140
-1

Its may be an Xcode version Problem.

Because in Xcode 4.2 it shows proper.

Myaaoonn
  • 1,001
  • 12
  • 25
-1

i think it is working for Xcode 4.2. I am not able to do in Xcode 4.5 if i am not writing any synthesized property.

@Implementation ViewController

#pragma mark -
#pragma mark Init

this code doesn't display Init. when i am writing below code in Xcode 4.5

@Implementation ViewController

@synthesize txtlabel;

#pragma mark -
#pragma mark Init

above code displays Init, So i think its Xcode problem.

Thanks, Sagar.

sagarcool89
  • 1,366
  • 8
  • 16