Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

xcodeNewbie

macrumors member
Original poster
Jul 1, 2011
65
0
I'm writing a chess app. I have an object that holds all the information for the board. My view controller is a delegate to that object, and the method checkmateOcurred:forBlack: is called when one player reaches checkmate. When someone is checkmated I use a UIAlertView to notify the player(s).
Code:
-(void)checkmateOccured:(BoardModel *)boardModel forBlack:(BOOL)forBlack {

    UIAlertView *av = [[[UIAlertView alloc] initWithTitle:@"Checkmate!" message:(forBlack ? @"Black Wins!" : @"White Wins!") delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil] autorelease];
    [av show];
}

When I test this in the iphone simulator, everything works great. However, when I run on a device the alert view doesn't show up. This method is indeed being called on the device, I used NSLog to check. The alert view just won't show up. I thought that maybe it was having trouble displaying it at that time, so I added some code to my viewDidLoad method to display an alert view right when the app starts. That one won't show up either. No alert view will show in my app. What's going on?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.