Quote:
Originally Posted by LeopardDevX
Thanks for reply...
I have no problem removing or adding subviews....
I tried it because i have a method to start the game....,, but i have placed the bricks with IB.
so the removed bricks doesnt pop up again.....
Isnt there an easier way to restart a view/level??
Regards... 
|
I can think of two options - as you remove the bricks from the view, put them in an array for safekeeping. Then add them back to the view when you reset.
I don't know of a way to "reset" views loaded from a nib without reloading the nib.
If the view is in a nib all by itself, you can re-create the view and its controller with something like:
Code:
ChatViewController *chatViewController = [[ChatViewController alloc] initWithNibName:@"chatView" bundle:nil];
That would create a ChatViewController, load the "chatView.nib" , and connect the File'sOwner to the ChatViewController.
If you're just using mainWindow.xib and letting it load automatically, that may be difficult; it expects File's Owner to be the app delegate, and I don't think you can re-create that.