Re: Spawning windows.
Re: Spawning windows.
- Subject: Re: Spawning windows.
- From: George <email@hidden>
- Date: Sun, 12 Nov 2006 01:01:41 -0500
Hi Marc,
I've been pouring over documentation on XCode, Interface Builder,
Cocoa, and Objective-C. All of these things are new to me. However,
Objective-C is not a problem for me because the concepts and syntax are
very much like SmallTalk, which I'm familiar with. I'm also very
familiar with C/C++ so that's not a problem either. I only need to
become more familiar with the class libraries. Putting all of the pieces
together with Interface Builder and XCode is what is giving me the most
trouble. Basically, I wasn't clear on what's in a NIB file and how they
interact with the Objective-C code.
After seeing a few sample pieces of code (from people on this list),
I now have a better understanding of things. I find that I learn much
quicker if I see a snippet of code as opposed to reading through stacks
of documents.
Thanks,
George
On Nov 10, 2006, at 2:43 PM, George C wrote:
Is there some sort of indentification associated with each window
> object?
No, but you could connect it to an outlet.
If I connect it to an outlet, do I need to allocate an instance of
it? What
would I do to make the window be displayed? What would the Cocoa code
look
like to do this?
George, what you need to do is read some getting started
documentation. Everyone is trying to help but making, what I judge
from your questions, an assumption that you know how to write a Cocoa
application using Objective-C. It seems pretty clear that you don't
(apologies if I misread you). This will help
(http://developer.apple.com/technotes/tn/tn2005.html). You don't
"spawn" windows when you use Interface Builder. Spawn means create.
What you want to do is show the window you have in your nib. An outlet
is an instance variable connected to an object. If you create an
outlet in your controller and connect it to your window, when your nib
is loaded, an instance of your controller will be instantiated and the
the window you laid out in IB will be created and the outlet will be
connected to it. You don't have to allocate an instance (I prefer to
say "instantiate" - I find using the object-oriented terminology helps
me) because that is done when the nib is loaded. Now that the window
is created and your controller instantiated and the outlet connected,
you can invoke any method on the window that it responds to (see all
the links that everyone has sent you). Finally, there is no such thing
as "Cocoa code." Cocoa is the name of a set of frameworks. Since Java
is deprecated, it's safe to say that you use Objective-C so you might
ask what the Objective-C code looks like but you might as well say
"will someone please write this for me."
Read the tutorials and read through the docs. After you've read some
documentation and tried some things, you'll be in better shape to ask
more meaningful questions.
Good luck
Marc
_______________________________________________
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