• 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: Safari-like View Change
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Safari-like View Change


  • Subject: Re: Safari-like View Change
  • From: Glenn Andreas <email@hidden>
  • Date: Thu, 23 Sep 2004 10:52:38 -0500

At 10:14 AM -0400 9/23/04, Kevin Ballard wrote:
Well, yes, you can, but then you have to keep track of indexes for things that aren't necessarily indexed. In my case, I have a list of plugins, and a tableview that lets me select the one to show the view for. The list in the tableview isn't necessarily the same list I have internally for my plugins (since it can be sorted and there's the potential of filtering out certain plugins), so instead I access them by name (which is good because my internal plugin manager uses names to access the components of the plugin). This would be much more complicated if I had to use a tab view and access it by index.

Then, since you've got a name, you can use the tab view item identifier.

In more detail (for the archives), something like:

- (void) addViewFromPlugin: (MyPlugin *)plugin
{
NSTabltemView *tabItem = [[NSTabItemView alloc] initWithIdentifier: [plugin name]];
[tabItem setView: [plugin view]];
[myTabView addTabViewItem: tabItem];
[tabItem release]; // we alloc/inited, we release
}


- (void) showViewForPlugin: (MyPlugin *)plugin
{
	[myTabView selectTabViewItemWithIdentifier: [myPlugin name]];
}



I've found that 90% of the time when I think "well, I can't use Foo because my program's architecture does things this way" it turns out that Foo is probably general enough to support it after all (either by identifiers, representedObjects, delegates, a simple NSDictionary, etc...)

Now it sounds like you've obviously got a solution that works for your needs, but hopefully in two weeks whem somebody wants to know how to switch between a dynamic list of views using names, they'll search the archives and find this thread. (It seems like almost any question is asked again two weeks later by somebody else).

--
Glenn Andreas email@hidden <http://www.gandreas.com/> oh my!
Mad, Bad, and Dangerous to Know
_______________________________________________
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
References: 
 >Safari-like View Change (From: Matt Diephouse <email@hidden>)
 >Re: Safari-like View Change (From: Scott Stevenson <email@hidden>)
 >Re: Safari-like View Change (From: Kevin Ballard <email@hidden>)
 >Re: Safari-like View Change (From: Kevin Ballard <email@hidden>)
 >Re: Safari-like View Change (From: Glenn Andreas <email@hidden>)
 >Re: Safari-like View Change (From: Kevin Ballard <email@hidden>)

  • Prev by Date: Re: Disabling Exposé
  • Next by Date: Re: Safari-like View Change
  • Previous by thread: Re: Safari-like View Change
  • Next by thread: Re: Safari-like View Change
  • Index(es):
    • Date
    • Thread