Re: Detail view beginner question
Re: Detail view beginner question
- Subject: Re: Detail view beginner question
- From: Yann Bizeul <email@hidden>
- Date: Thu, 17 Jun 2004 14:23:01 +0200
>
Now the question is: Is it better to have a second controller class
>
for that window (in the future i will have two or three slightly
>
different objects in the table and want to adapt the info-window
>
accordantly ) and how I connect the text fields in the info window
>
with my tableview.
If you need different windows for each kind of information you show in
the TableView, and depending how often and when you would need these
windows, perhaps I would choose to have a nib for each item type.
The nib owner would be a NSWindowController subclass, responsible of
getting current objet and display/update it's infos.
Now how to get the current object ? I'm asking assistance of more
skilled OOP people, bacause myself will hesistate between different,
more or less clean, solutions (Be indulgent, I'm reading a book on
Design Patterns !) :
- Have CurrentObjectController singleton shared for the whole
application
- Subclass NSApplication and add a -(id)currentObject method
- add an initialization method to your NSWindowController subclass like
this :
- (NSWindowController*)initWithWindowNibName:(NSString*)aName
object:(MyObject*)anObject
...
--
Yann Bizeul - yann at tynsoe.org
http://projects.tynsoe.org/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.