remove every type of subview from uiscrollview?

hello all i am using this code to show flip animation...... i have a uiview with scrollview(paging enabled)...so it shows a view like a page...now i also have done flip animation using this code....

-(void)flipView
{
    flashCardAnswerController *flashCardAnswerControllerobj =  [[flashCardAnswerController alloc] initWithNibName:@"FlashCardAnswerView" bundle:[NSBundle mainBundle]];
[flashCardAnswerControllerobj.view setFrame:[[self view] frame]];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.60];// Sub. duration  
UIView *superview;
     if ((superview = [[self view] superview])) {
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft   forView:superview cache:YES];
    [superview addSubview:[flashCardAnswerControllerobj view]];
}
[UIView commitAnimations];
}

so according to code the new view will be added to scrollview..i also manage to release the new view while flipping back...but if i directly push the back button on navigaion controller...the flip side view won't release. i tried this in dealloc method of my scrolleview's class but it doesn't work

for(UIView *subview in [scrollView subviews]) {
        [subview removeFromSuperview];
}

how do i remove flipside's view the views are very much in number...approx. 48 plus 48 flip side views so definietly it will create memory issues on device...

also could someone tell me a way to disable NavigationBar's back button in flip side view...without creating scolling class's object.

Answers


I do not have a direct answer to your question, but I can tell that this is the old iPhone OS 2.x way of displaying a views flip-side.

In iPhone OS 3.0 you should use presentModalViewController:animated: instead. This is much less code, and all of the problems you describe in your questions goes away.

The idea is that the flip-side of the current view, is managed by a separate UIViewController that you display modally. But in addition to the sliding animation from 2.0 you can also have the new view controller animate in and out with a horizontal flip.

self.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:flipSideController
                        animated:YES];

[[scrollView subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)]

Need Your Help

How can I fadeIn/fadeOut of text using jQuery (or CSS)?

javascript jquery html

I'm building a random quote generator and would like to use the fadeIn/fadeOut function when switching between quotes when prompted by a button click. However I'm not sure how to target the text in

How can I check the system before I reboot it?

linux centos reboot

Just wondering if there is any possible way to know if I reboot the machine (CentOS), it won't get stuck half way in the middle?