tags:

views:

263

answers:

2

hi,i coded in button action like

  [UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:mainDelegate.window cache:NO];
[mainDelegate.window addSubview:[self.calcentryController view]];
[UIView commitAnimations];

it works fine,but when i use in calcentryController.m in one action

  [self presentModalViewController:self.weeklyScoreController animated:YES];

to go another viewcontroller , it is not working any help pls?

A: 

Is there any reason you aren't using presentModalViewController for calcentryController? You can set modalTransitionStyle on calcentryController to UIModalTransitionStyleFlipHorizontal and just use presentModalViewController:animated instead of doing manual animations.

The reason this may help is because your code is not calling certain functions like viewWillAppear:, viewDidAppear:, etc., whereas presentModalViewController:animated calls all the right functions for presenting new views.

Ed Marty
A: 

It's possible that your weeklyScoreController is nil. I'm not sure where you create it, since the code block is not pasted but that's a common mistake I see.

Malaxeur