remove every type of subview from uiscrollview?
صفحه اصلي

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.


Saving reference to UITableViewCell

1:

Reformatting for landscape view
I did not have a direct answer to your question, although I must tell this this is the old iPhone OS 2.x way of displaying a views flip-side.. Fade in/out UIScrollView's content like Mobile Safari does in its tab In iPhone OS 3.0 you should use presentModalViewController:animated: instead. warning: declaration does not declare anythingThis is enough less code, and all of the problems you describe in your questions goes away.. How to Base64 encoding on the iPhone The idea is this the flip-side of the current view, is managed by a separate UIViewController this you display modally. UIWebView slow loading images--disturbs scrolling to anchorsBut in addition to the sliding animation from 2.0 you must also have the new view controller animate in and out with a horizontal flip.. iPhone / .NET WCF Interoperability
self.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [self presentModalViewController:flipSideController                         animated:YES]; 
UIScrollView

2:

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


48 out of 100 based on 18 user ratings 378 reviews