Re: Multiple Views Using One Window
Re: Multiple Views Using One Window
- Subject: Re: Multiple Views Using One Window
- From: Uli Kusterer <email@hidden>
- Date: Sat, 19 Jan 2008 12:28:22 +0100
On 19.01.2008, at 09:02, Jaime Magiera wrote:
- (IBAction) updateSubview:(id) sender
{
[currentSubview removeFromSuperview];
currentSubview = subViewX // use some logic, index, etc. to
determine the next desired subview, and copy it to the
currentSubview variable
[mainBox addSubview];
}
Don't forget to retain the subviews. Adding a view to a superview
retains it, and removing it again releases it, so if you want to
remove a subview from one view and add it to another, you may want to
[[myView retain] autorelease] it to make sure it doesn't get disposed
before you've re-added it.
All that is of course is only necessary if you haven't otherwise
retained the view already, and only if you're running non-GC.
Cheers,
-- M. Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden