Quote:
Originally Posted by LeopardDevX
I`m using mainWindow.xib as my nibfile, but instead of using a viewcontroller, i`m just using a view as my top on the "View Tree" and i`m adding subViews from that view and removing them from the views.
So this safeKeeping array how does that work..?
Will they keep the position i gave them in the Interface Builder?
|
They should keep the last position they had - the center and frame are both properties of the UIView object you're saving. I haven't tried this - it's just an idea - so back up your project before starting this.
Code:
//safeKeeping should be an NSMutableArray
//when you want to save the views
[safeKeeping addObject: myBlock];
[myBlock removeFromSuperview];
//loop through the views you want to put back
for (UIView *myBlock in safeKeeping){
[topView addSubview: myBlock];
}
//clean out the array
[safeKeeping removeAllObjects];