NSNotificationCenter AppDelegate post notification problems
===

My application performs a series of processing methods once a day or when a local notification is received to perform the series of tasks and is working as expected. 

I tried adding an ActivityIndicator to a view that begins animating when a notification sent from the AppDelegate to perform the tasks is received. However all that happens is the screen darkens and none of the processing is done and the activity indicator doesn't appear. The indicator and subview that darkens the screen is used elsewhere in the app and is definitely working. I think it must be something to do with the notifications causing the app to hang and not proceed to call any of the other methods so it never completes.

This is the notification in the app delegate which is called just before the daily processing methods are called to start the activity indicator in a view controller, and the second one notifies the view controller to remove the subviews.

    [[NSNotificationCenter defaultCenter] postNotificationName:@"ranking" object:nil];

    [[NSNotificationCenter defaultCenter] postNotificationName:@"rankingDone" object:nil];

Which is picked up in another view, with the notifications setup in `viewDidLoad`.

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(workingWhileRanking:) name:@"ranking" object:nil];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(workingFinishedRanking:) name:@"rankingDone" object:nil];

And those call these methods in that view.

    -(void)workingWhileRanking:(NSNotification *) notification{
        
        loading = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; 
        
        loading.opaque = NO;
        loading.backgroundColor = [UIColor colorWithWhite:0.0f alpha:0.6f];
        
        indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
        [indicator setHidesWhenStopped:YES];
        indicator.center = self.view.center;
        
        [indicator startAnimating];
        [self.view addSubview:loading];
        [self.view addSubview:indicator];
        
    }
    
    -(void)workingFinishedRanking:(NSNotification *) notification{
        
        [indicator stopAnimating];
        [indicator removeFromSuperview];
        [indicator release];
        [loading removeFromSuperview];
        [loading release];
        
    }

The notifications must be sent as the translucent subview appears, however none of the processing methods seem to be called so the view is permanently locked out until I force close the app. 

Does sending the notification change the current flow of the applications launch sequence thereby ceasing to continue executing code in a class? Or have I gone about trying to add an activity indicator to show during some behind the scenes processing the complete wrong way?

