In iOS 5 and 6 there is a call back on UIViewcontrollers for autorotation. I would just set a flag when you start your calculation that you shouldn't autorotate and set it back when you are done.
//somewhere in .h or class extension or simple member variable
@property (nonatomic) BOOL shouldRotate;
// iOS 6
- (BOOL)shouldAutorotate {
return self.shouldRotate;
}
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;//Return what is supported
}
// pre-iOS 6 support
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
return self.shouldRotate && //other interface check;
}
-(void)calculate{
self.shouldRotate = NO;
//do calculation
self.shouldRotate = YES;
}