Re: copying views how to but change 1 w/o changing the other?
Re: copying views how to but change 1 w/o changing the other?
- Subject: Re: copying views how to but change 1 w/o changing the other?
- From: "Alan Smith" <email@hidden>
- Date: Sat, 6 May 2006 20:43:06 -0400
I don't think I understand correctly because what I tried didn't work. :)
So I made a class that handles the tab switching. In that class is an array
that holds the views. If a tab is going to be selected it copies the view of
the current tab into the array and then sets the new tab to hold the view
that it used to have. Since I'm using one view and copying it, it seems to
be just a pointer kind of. The tabs all contain the exact same view.
Surly this is not impossible?
Thanks, Alan
On 5/5/06, Nick Zitzmann <email@hidden> wrote:
On May 5, 2006, at 9:35 AM, Alan Smith wrote:
> The part that doesn't do quite what I want
> is, I create a new tab and use the view from the current tab and
> set it as
> the new tab's view. The problem is that when you change the view in
> one tab
> the same thing happens in the other. What can I do to avoid this? I
> want the
> views to be independent of the other.
Create a view controller class that owns the views placed within the
tab view and keeps the state of things that occur within each view.
Have the window controller keep track of the view controllers, and
when the user switches tabs, then you can obtain the view to place
within the tab view from the view controller. This will increase the
amount of memory your app uses, but it will solve the problem.
Nick Zitzmann
<http://www.chronosnet.com/>
--
// Quotes from yours truly -------------------------
"You don't forget, you just don't remember."
"Maturity resides in the mind."
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden