NSTextField input goes to build window
NSTextField input goes to build window
- Subject: NSTextField input goes to build window
- From: Sean McGroty <email@hidden>
- Date: Mon, 13 Dec 2004 13:26:42 -0500
For a introductory Cocoa application, I'm trying to write an
application that implements Newton's Method for finding square roots.
Unfortunately, I have come across an issue that I don't understand, and
can't reliably duplicate. In short, text input to the NSTextFields in
the app is broken.
I constructed the latest attempt as follows:
I created a new Cocoa Application in Xcode, named Newton's Method, and
started by editing the nib file.
First, I added three NSTextLabels and three NSTextFields to the default
window, positioning and labeling them as needed. One of the
NSTextFields is for output, so I unchecked its Editable property. Next,
I changed the default window title to Newton's Method and resized the
window to a more appropriate size. Then, I modified the MainMenu
object, removing everything but the Application menu (the app doesn't
have any use for the other menu choices). In the Application menu, I
changed all the NewApplication occurrences to Newton's Method. Finally,
I created WindowController as a subclass of NSObject, instantiated it,
and added three outlets. I connected these outlets to their
corresponding NSTextFields. I set the initialFirstResponder on the
Window object and nextKeyView on two of the NSTextFields so that the
user can tab from one field and back to the previous. Before saving, I
changed the Nib file format to 10.2 And Later Format (I intend to add
hidden NSTextFields at a later time). I then created the source files,
saved, and quit Interface Builder.
I then compiled the program, without making any code additions of my
own. When I run the program, input to the text fields "leaks" through
to the build window. This includes tabs, so I can't tab from field to
field. Also, the program never gets its own Dock icon, so I have to
click the Stop button in the build window to kill the program. Pressing
command-q quits Xcode, rather than the app.
I know it's something with Interface Builder, since I haven't added any
code to the project. It also seems to be related to multi-word project
names (maybe the apostrophe in Newton's Method), since other tests with
single and two-word project names sometimes work properly. I also tried
projects where I added elements one at a time, then tested, but I
didn't see a pattern.
What am I missing?
_______________________________________________
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