views:

24

answers:

1

Hello, I would my view controller to post a notification used NSNotificationCenter if the orientation is landscape. I'm currently doing this:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return YES;
    if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight) {

    [[NSNotificationCenter defaultCenter] postNotificationName:@"change" object:self];
    }
}

I don't seem to get a response in my other file. What am I doing wrong?

+1  A: 

You're returning YES before you send your notification. It never gets called.

Matt Long