• 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: Best data source for table view in document window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best data source for table view in document window


  • Subject: Re: Best data source for table view in document window
  • From: Seth Willits <email@hidden>
  • Date: Wed, 05 Sep 2012 11:53:41 -0700

On Sep 5, 2012, at 5:39 AM, Jerry Krinock wrote:

> … except that my window controller for this multi-tabbed window is already huge.

In a complex window where there a multiple tabbed views like you have, think of the window controller as doing nothing more than managing the view controllers for each of the tabs, not the actual views in each tab. If your window controller is getting monolithic, it's time for a refactor.


For example:
http://araelium.com/querious/screenshots/query_75p.png


(Ignoring the affects of having literal tabs in this window…) Each view up in the toolbar is a separate view controller, which is possibly composed of one or more child view controllers. In this particular screenshot, you're looking at four. The window controller has a piddly 600 lines of code in it which is merely for creating and swapping out views of the top level view controllers, etc. The real work is all done in a tree of view controllers.


There's a view controller responsible for doing nothing more than managing the table view displaying the query results table, and basically has this interface:


@interface ResultListViewController : NSViewController {
	NSTableView * resultListTableView;
	NSArrayController * resultListArrayController;
}

@property (readwrite, retain) NSArray * results;

@end



The view controller is the delegate and data source for the table view and manages a bunch of little things related to the table.




--
Seth Willits





_______________________________________________

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


  • Follow-Ups:
    • Re: Best data source for table view in document window
      • From: Chris Hanson <email@hidden>
References: 
 >Best data source for table view in document window (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: How to Identify a "Phantom" Write Operation
  • Next by Date: Re: Best data source for table view in document window
  • Previous by thread: Re: Best data source for table view in document window
  • Next by thread: Re: Best data source for table view in document window
  • Index(es):
    • Date
    • Thread