Re: how to instantiate MyDocument with file from open panel?
Re: how to instantiate MyDocument with file from open panel?
- Subject: Re: how to instantiate MyDocument with file from open panel?
- From: Nathaniel Gottlieb-Graham <email@hidden>
- Date: Fri, 7 Dec 2007 00:32:45 -0500
I am using the document architecture, and I had suspected that I was
doing something dumb. My situation is this: On my application's
launch, I want it to display a "welcome screen" of sorts, one of whose
buttons triggers an open panel and prompts the user to choose a movie.
A new document containing the movie in a player on that document's
window will then be created.
At the moment, I have the welcome screen, and a button does prompt the
user to select a file and then packages it up into a QTMovie. What I
need to do next is simply create a new document and put that movie
into one of its instance variables (the QTMovieView, I think). To
this end, I was trying to manually instantiate a MyDocument subclass
in the openPanelDidEnd: selector. If there's a better way to
accomplish what I want, I'm all ears.
On Dec 6, 2007, at 10:06 PM, mmalc crawford wrote:
On Dec 6, 2007, at 11:59 AM, Nathaniel Gottlieb-Graham wrote:
I've run an open panel and called the openPanelDidEnd: selector,
and I have the file the user has chosen in an array. Now I'm a
little stuck because I want to do something with that file; I want
a new MyDocument instance to be created and load the data from the
file into a QTMovieView I've set up in IB.
Are you using the document architecture (i.e. are you subclassing
NSDocument)?
If so, it's not clear why you are trying to run your own open panel
or instantiate your own document instance. Typically you simply let
the framework take care of all the details for you -- see <http://developer.apple.com/documentation/Cocoa/Conceptual/Documents/Tasks/ImplementingDocApp.html
>.
mmalc
---------------------------------
Nathaniel Gottlieb-Graham
Mac specialist
email@hidden
techpaladin.com
_______________________________________________
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