Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Nov 11, 2011, 06:45 AM   #1
Wellington2k
macrumors regular
 
Join Date: Jun 2011
Resetting a UIView

Hello.

I have a ViewController (Menu) that then switches to a UIView (Level_1).
When you die in the UIView (Level_1) it then switches to another UIView (Loss of life animation) and then switches back to Level_1.

Now the problem. I can't get into detail, but it is a major issue and it only happens when I switch back to the UIView (Level_1).
The only possible way to fix it would be to reset the UIView (Level_1) to its original state when you switch from Loss of life animation.

I have already tried resetting all the variables, but it doesn't help.
Is there a code to reset everything in a UIView?

Thanks!

Last edited by Wellington2k; Nov 11, 2011 at 06:51 AM.
Wellington2k is offline   0 Reply With Quote
Old Nov 11, 2011, 07:20 AM   #2
jnoxx
macrumors 65816
 
jnoxx's Avatar
 
Join Date: Dec 2010
Location: Aartselaar // Antwerp // Belgium
Code:
    UIView *view;
    [view reloadInputViews];
No idea, but maybe that should work?
jnoxx is offline   0 Reply With Quote
Old Nov 11, 2011, 08:15 AM   #3
nickculbertson
macrumors regular
 
Join Date: Nov 2010
Location: Nashville, TN
Quote:
Originally Posted by Wellington2k View Post
I have already tried resetting all the variables, but it doesn't help.
This should work. How did you attempt this? Did you reset your variables before you changed views?

Or, you could just have your "life loss" view merged with your "Level_1" view as hidden layers and reset you variables there.

Code:
//image1 is a UIImage
-(IBAction)dead{
deadmenu.image=image1;
deadmenu.hidden=NO;
//reset variables here  
}
-(IBAction)nextlife{
deadmenu.hidden=YES;
deadmenu.image=nil;
//set this imageview to nil when you are not using it and it won't use up any unwanted memory
}
Nick
__________________
My App Blog --->
nickculbertson is offline   0 Reply With Quote
Old Nov 11, 2011, 08:20 AM   #4
Wellington2k
Thread Starter
macrumors regular
 
Join Date: Jun 2011
nickculbertson you are AMAZING!!!

Thanks SO much!

I've wrestling with this all week!

Last edited by Wellington2k; Nov 11, 2011 at 08:42 AM.
Wellington2k is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Tags
help me, issue, reset, uiview, variables

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
How to navigate from UIView to UIViewController fypj2013 iPhone/iPad Programming 6 Mar 25, 2013 04:37 PM
Trying to subclass UIView Hans Kamp iPhone/iPad Programming 3 Mar 25, 2013 12:15 AM
Archiving Custom UIView Ides iPhone/iPad Programming 14 Aug 8, 2012 05:44 PM
Simple UIView Question krayziekray iPhone/iPad Programming 5 Jun 19, 2012 05:17 AM
make uiview transparent without having the uiview's buttons transparent johnmerlino iPhone/iPad Programming 7 Jun 1, 2012 02:20 AM

Forum Jump

All times are GMT -5. The time now is 07:20 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC