Pragma marks now showing up in jump bar


#1

I’m running Xcode 4.5 and my pragma marks are not showing up in the jump bar. Any clue as to why?


#2

I believe the title should be “Pragma marks NOT showing up in jump bar” (one of those examples where a small typo plays havoc with the human brain code compiler :wink: )

I’m having the same problem. After a bit of googling around I found this discussion on StackOverflow:
stackoverflow.com/questions/5313 … -xcode-4-0

to summarize: apparently there’s some kind of problem inserting a #pragma mark before the first method.
Try putting it after the first method & you’ll see it appears. The thread suggests a couple of different hacks or workarounds for getting it to appear before the first block.


#3

If you’re a paid member of the dev program, try it out in Xcode 4.6 DP-3.

It’s unexpected/buggy behavior if marks aren’t appearing before the first method, and will likely be fixed in a future release. They should work fine anywhere in the file.


#4

I can’t get the pragma mark to show up even with the workaround. Using XCode 5. Any ideas? Thanks

[code]@implementation BNRAppDelegate

{

#pragma mark - Application delegate callbacks

}

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {

    // Attempt to load an existing to-do dataset from an array stored to disk.
    NSArray *plist = [NSArray arrayWithContentsOfFile:docPath()];

    if (plist)
    {
    // If there was a dataset available, copy it into the instance variable.
    tasks = [plist mutableCopy];

    } else {
    // Otherwise, just create an empty one to get us started.
    tasks = [[NSMutableArray alloc] init];
    }
    return YES;
    }[/code]


#5

You problem a syntax have massive:)
Compare yours to:

@implementation BNRAppDelegate

#pragma mark - Application delegate callbacks
    
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    
    
    // Attempt to load an existing to-do dataset from an array stored to disk.
    NSArray *plist = [NSArray arrayWithContentsOfFile:docPath()];
    
    if (plist)
    {
        // If there was a dataset available, copy it into the instance variable.
        tasks = [plist mutableCopy];
        
    } else {
        // Otherwise, just create an empty one to get us started.
        tasks = [[NSMutableArray alloc] init];
    }
    return YES;
}
@end

#6

Thanks for the reply, but I don’t get it.

I put the {} around the pragma mark because that was the common workaround for getting the pragma to show up in the list. I have tried it with and without and it doesn’t show up either way.

My code seems to be working otherwise. I just want to make sure that I am doing this totally correct.

Thanks for your help.

[quote=“ibex10”]You problem a syntax have massive:)
Compare yours to:

[code]
@implementation BNRAppDelegate

#pragma mark - Application delegate callbacks

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {

    // Attempt to load an existing to-do dataset from an array stored to disk.
    NSArray *plist = [NSArray arrayWithContentsOfFile:docPath()];

    if (plist)
    {
    // If there was a dataset available, copy it into the instance variable.
    tasks = [plist mutableCopy];

    } else {
    // Otherwise, just create an empty one to get us started.
    tasks = [[NSMutableArray alloc] init];
    }
    return YES;
    }
    @end
    [/code][/quote]


#7

OK it is showing up as Application delegate callbacks. I was looking for something that said “pragma…”

Thanks Ibex.