Re: Opening a window in Core Data application
Re: Opening a window in Core Data application
- Subject: Re: Opening a window in Core Data application
- From: Wain <email@hidden>
- Date: Thu, 30 Mar 2006 21:15:36 +0100
Hi,
For information you can:
1.
Assuming Alexandria_AppDelegate is called the app delegate for a
reason you can call:
Alexandria_AppDelegate *delegate = [[NSApplication sharedApplication]
delegate];
to return your app delegate instance.
You can then add and call an accessor on Alexandria_AppDelegate to
access the outlet.
2.
You could call - (void)setTarget:(id)anObject and - (void)
setDoubleAction:(SEL)aSelector on your archive table view to receive
callbacks when it is double clicked.
Although why do you want this interaction between your two windows?
It doesn't sound very normal or user friendly to me.
The normal way this type of interface might be put together is to
have the current contents of the second window (editing stuff) below
the archive table view in the first window.
Alternatively maybe the second window could be an inspector panel
rather than a standard window.
Wain
On 30 Mar 2006, at 20:46, Wayne Pascoe wrote:
Hi all,
I am trying to write a core data application that will use two
windows. I am trying to provide alternative methods to open the
windows (other than just a button).
The first window is a list of archives showing the name, the
description and the creation date of an archive - http://
www.penguinpowered.org/content/MainWindow.png
The second window is where the user will enter data about the
archive - http://www.penguinpowered.org/content/EditWindow.png
At the moment, the only way I can open the edit window is to add a
record in the main window (+ button in bottom right), select it in
the main window, and click the edit button. The edit button's
target is the edit window's makeKeyAndOrderFront method.
What I'd like to be able to do is the following:
1. Open the window automatically when the user adds a new record. I
am using an ArrayController named ArchiveMO to manage the data, and
I have overridden the awakeFromInsert method to automatically set
the date to the current date. I have also added an outlet to the
main class (Alexandria_AppDelegate) named archiveEditWindow.
The awakeFromInsert method seems like the ideal place to add this
code, but I can't work out how to access the outlet defined in
Archive_AppDelegate.h from ArchiveMO.m. Can anyone give me some
pointers on this ?
2. I'd also like to be able to open the edit window when the user
double-click's on an archive. I don't even know where to start with
this.
If anyone can advise me how to go about this, or just point me at
some documentation that covers this and tell me to RTFM, I'd be
greatful :)
In case they are of use in diagnosing this problem, I have posted
Alexandria_AppDelegate.h at http://www.penguinpowered.org/content/
Alexandria_AppDelegate.h and ArchiveMO.m at http://
www.penguinpowered.org/content/ArchiveMO.m
Thanks in advance,
--
Wayne Pascoe (gpg --keyserver www.co.uk.pgp.net --recv-keys
79A7C870)
I refuse to tiptoe quietly through life only to arrive safely at
death!
_______________________________________________
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