
Untitled
By: a guest on
May 16th, 2012 | syntax:
None | size: 1.50 KB | hits: 25 | expires: Never
ios: Navigation to another screen using modalTransitionsytle attribute, crashes the app
@interface Navigation : UINavigationController
{
}
-(void)popToMainMenuAnimated:(BOOL)animated;
//.m file
-(void)popToMainMenuAnimated:(BOOL)animated
{
UIViewController *element;
for(element in self.viewControllers)
{
if([element isKindOfClass:[MainSettingClass class]]){
self.modalTransitionStyle = UIModalTransitionStylePartialCurl;
[self presentModalViewController:element animated:YES]
}
}
}
-(void)popToMainMenuAnimated:(BOOL)animated
{
UIViewController *element;
for(element in self.viewControllers) {
if([element isKindOfClass:[MainSettingClass class]]) {
self.modalTransitionStyle = UIModalTransitionStylePartialCurl;
[self presentModalViewController:element animated:YES];
break;
}
}
}
-(void)loadMainMenuAnimated:(BOOL)animated
{
MainSettingClass * mainMenuViewController = [[[MainSettingClass alloc] init] autoreleased];
[mainMenuViewController.view setFrame:CGRectMake(0.0f, 0.0f, 320.0f, 480.0f)];
// ...
self.modalTransitionStyle = UIModalTransitionStylePartialCurl;
[self presentModalViewController:mainMenuViewController animated:YES];
}
self.modalTransitionStyle= UIModalTransitionStylePartialCurl;
[self popToViewController:element animated:YES];
[self presentModalViewController:yourViewController animated:YES];
[self popToViewController:element animated:YES];