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.
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?
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
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.
Using an empty block:
@implementation RandomClass
{}
#pragma mark - Getter Methods
- (void) firstMethod
{
}
@end
Adding the pragma mark inside the empty block itself:
@implementation RandomClass
{
#pragma mark - Getter Methods
}
- (void) firstMethod
{
}
@end
It doesn't look too pretty but it works. I hope that helps.
I had this problem while using a syntax that used to work on xcode 3.x and does not work for xcode 4 anymore.
I was using just "pragma"
#pragma - My Pragma Text
That used to work fine for xcode 3 but, for xcode 4, the complete syntax has to be used. This means that #pragma must always be followed by the "mark" keyword.
#pragma mark - My Pragma Text
EDIT
Xcode 6 (fixed in beta 4) uses // MARK:
syntax for swift
files
Did #pragma marks work inside of methods in the previous xcode? I really would like to use them, but like you said, it only works in between methods but not within a method, which would be really useful.
BUMP if anybody has any ideas on ways to achieve adding code to a section within a method that would add it to the XCode jump bar...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With