• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Multiple Views Using One Window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Multiple Views Using One Window (From: Philip Bridson <email@hidden>)
 >Re: Multiple Views Using One Window (From: Jaime Magiera <email@hidden>)

  • Prev by Date: Re: Multiple Views Using One Window
  • Next by Date: Re: Cursor duplication problem
  • Previous by thread: Re: Multiple Views Using One Window
  • Next by thread: Where the file is?
  • Index(es):
    • Date
    • Thread