Hi all.
Trouble tracking down a bug. It since it doesn't occur on my iphone 4.
When the player wins a game I put up a UIAlert with a text field.
but it crashes when the UIAlert is shown. The Alert overtop of a MOV?
Could that be what's causing the crash? That code follows.
Any Ideas. As I said, it works perfectly on my iphone 4 with iOS 7, but I understand how it would Suk if you win and then it crashes where you enter your name... sigh...
thanks
Ian
Trouble tracking down a bug. It since it doesn't occur on my iphone 4.
When the player wins a game I put up a UIAlert with a text field.
Code:
-(void)showWinAlert
{
NSLog(@"gameTime was:%@",userScore.gameTime);
NSMutableString *messageAlert = [[NSMutableString alloc]initWithFormat:
@"with Time: %@",userScore.gameTime];
// Testing alert //
winAlert = [[UIAlertView alloc] initWithTitle:@"New High Score!!!"
message:messageAlert
delegate:self
cancelButtonTitle:@"OK !"
otherButtonTitles:nil];
// if High Score then //
[winAlert setAlertViewStyle:UIAlertViewStylePlainTextInput];
[winAlert textFieldAtIndex:0].keyboardAppearance = UIKeyboardAppearanceAlert;
[winAlert becomeFirstResponder];
[[winAlert textFieldAtIndex:0] setTextAlignment:UITextAlignmentCenter];
[winAlert textFieldAtIndex:0].text=@"YourName";
// hilight all the text in the field //
// delegate the textfield in the Alert so we can limit size of input //
UITextField *theTitleTextField = [winAlert textFieldAtIndex:0];
theTitleTextField.delegate = winAlert.delegate;
[myTable reloadData];
[winAlert show];
}
but it crashes when the UIAlert is shown. The Alert overtop of a MOV?
Could that be what's causing the crash? That code follows.
Code:
-(void)playWinMovie
{
initWithFrame:CGRectMake(0,0,cgSize.width,cgSize.height)];
NSString *url = [[NSBundle mainBundle] pathForResource:@"TheEnd_Music" ofType:@"mov"];
player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:url]];
player.controlStyle = MPMovieControlStyleNone;
player.scalingMode = MPMovieScalingModeAspectFill;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(movieFinnishedCallback:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:player];
// set the size of the movie //
player.view.frame = CGRectMake(0, 0,CGRectGetWidth(screenBounds),
CGRectGetHeight(screenBounds));
[player.view setAlpha:0.2];
[player.view setHidden:NO];
[[self window] addSubview:player.view];
[player play];
[audioPlayer pause];
}
Any Ideas. As I said, it works perfectly on my iphone 4 with iOS 7, but I understand how it would Suk if you win and then it crashes where you enter your name... sigh...
thanks
Ian