Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

schenker

macrumors newbie
Original poster
Jul 14, 2011
19
0
Hi, i have a number of images and buttons in my current view. Instead of removing one at a time, i removed my uiview like so in viewDidDisappear:
Code:
 [currentView removeFromSuperview];

its saves me so much trouble and it definitely works! but im worried if this is a bad way of doing things. Hope to hear from you guys. Thanks.
 
in your viewDidDisappear? so your removing it, when your view is already disappearing, I think you're misunderstanding the flow.
In what kind of way would you do this, or need this.
I use removeFromSuperview alot. but not in the viewDidDisappear..

Hope to hear back.
 
Thanks for replying. This is what happens:

- this page is actually a level selection game
- at viewWillAppear, it will determine what are the newly unlocked levels and replace the icons with image of an unlocked icon.
-it also has to remove the locked image that's now being unlocked --> This is where the problem begins
- i realise that for the locked image to be completely removed, the uiview has to be refreshed and loadview has to be called again.
- to 'force' loadview' to be called whenever i come to this screen, i removed the view as mentioned in my previous post.

it works, but im a little upset if this is right.

Thanks.


in your viewDidDisappear? so your removing it, when your view is already disappearing, I think you're misunderstanding the flow.
In what kind of way would you do this, or need this.
I use removeFromSuperview alot. but not in the viewDidDisappear..

Hope to hear back.

Hi jnoxx, You are right. I need not do it this way. I fine-tuned my code and it works now even without having to use "viewdiddisappear". Thanks so much, your feedback did help me! :)
 
Last edited by a moderator:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.