Thread View: comp.sys.next.programmer
3 messages
3 total messages
Started by Eskandar Ensafi
Wed, 04 Nov 1992 18:27
Trouble creating 3.0 applications
Author: Eskandar Ensafi
Date: Wed, 04 Nov 1992 18:27
Date: Wed, 04 Nov 1992 18:27
39 lines
2196 bytes
2196 bytes
Hi,
I converted some of my 2.1 apps to 3.0 and everything recompiled without
problems. However, when I tried to create a new app under 3.0, it didn't work!
This is what I did in a desperate attempt to create an app that would run
(NOTE: the following worked under 2.1 buit failed under 3.0):
1) In IB, I made a new application and added a TextField to the window.
2) I made the app a sublass of Application (MyApplication).
3) I created an outlet called myText in MyApplication.
4) I connected myText to the TextField in my window.
5) I unparsed the .[hm] files and used Edit to modify them as follows:
a) Added method - appDidInit:sender to "MyApplication.h"
b) I added #import <appkit/TextField.h> to "MyApplication.m" and also
wrote the following code for the above method:
- appDidInit:sender /* I also tried appDidInit:app */
{
[myText setStringValue:"This is a test."];
/* I tried this code with and without [myText display] */
return self;
}
6) I used PB to make this into a project and compiled it.
7) I discovered that 3.0 breaks all connections when you make a subclass, so I
had to reconnect "Quit" and "Hide" to - terminate: and - hide: (obviously,
nither button worked when my app was compiled).
8) My text field did NOT display "This is a test." -- the appDidInit method is
not invoked for some reason.
Please help me figure out this problem and why I did not have the same problems
under 2.1 (e-mail preferred).
Thank You!
- Eskandar Ensafi, esky@marathon.cs.ucla.edu
Re: Trouble creating 3.0 applications
Author: Moises Oliveira
Date: Thu, 05 Nov 1992 00:01
Date: Thu, 05 Nov 1992 00:01
31 lines
1580 bytes
1580 bytes
In article <1992Nov4.182700.18323@cs.ucla.edu> esky@marathon.cs.ucla.edu writes: >Hi, > >This is what I did in a desperate attempt to create an app that would run >(NOTE: the following worked under 2.1 buit failed under 3.0): [Long series of items in which the key to the problem is missing. > a) Added method - appDidInit:sender to "MyApplication.h" [appDidInit: is never called.] appDidInit: should be implemented as a delegate method, but can also be implemeneted as a subclassed method. The reason it is never being called is because NXApp is an application object and not a MyApplication object. Look at the project_main.m file and you will see what I mean. Don't edit the main.m file though, change it in ProjectBuilder (attributes pane) > >Please help me figure out this problem and why I did not have the same >problems under 2.1 (e-mail preferred). > You didn't have the problem previosuly, because the main.m file used to be maintained by IB.
Re: Trouble creating 3.0 applications
Author: Ricardo Parada
Date: Thu, 05 Nov 1992 22:08
Date: Thu, 05 Nov 1992 22:08
62 lines
2909 bytes
2909 bytes
In article <1992Nov4.182700.18323@cs.ucla.edu> esky@marathon.cs.ucla.edu
(Eskandar Ensafi) writes:
> Hi,
>
> I converted some of my 2.1 apps to 3.0 and everything recompiled without
> problems. However, when I tried to create a new app under 3.0, it
didn't work!
> This is what I did in a desperate attempt to create an app that would
run
> (NOTE: the following worked under 2.1 buit failed under 3.0):
>
> 1) In IB, I made a new application and added a TextField to the window.
> 2) I made the app a sublass of Application (MyApplication).
> 3) I created an outlet called myText in MyApplication.
> 4) I connected myText to the TextField in my window.
> 5) I unparsed the .[hm] files and used Edit to modify them as follows:
>
> a) Added method - appDidInit:sender to "MyApplication.h"
> b) I added #import <appkit/TextField.h> to "MyApplication.m" and
also
> wrote the following code for the above method:
>
> - appDidInit:sender /* I also tried appDidInit:app */
> {
> [myText setStringValue:"This is a test."];
> /* I tried this code with and without [myText
display] */
> return self;
> }
>
> 6) I used PB to make this into a project and compiled it.
> 7) I discovered that 3.0 breaks all connections when you make a
subclass, so I
> had to reconnect "Quit" and "Hide" to - terminate: and - hide:
(obviously,
> nither button worked when my app was compiled).
> 8) My text field did NOT display "This is a test." -- the appDidInit
method is
> not invoked for some reason.
>
> Please help me figure out this problem and why I did not have the same
problems
> under 2.1 (e-mail preferred).
>
> Thank You!
>
> - Eskandar Ensafi, esky@marathon.cs.ucla.edu
>
>
Click on the Objects suitcase and then when it displays all your objects
click on the "File's Owner" object and then do Command-1 to display the
Attributes Inspector Panel for the File's Owner and make sure that it says
that the File's Owner is of the class MyApplication. If it is of the
class Application or some other class then click on MyApplication so that
the correct class is intantiated in main().
--
+ Ricardo J. Parada
"Imagination is more important than knowledge!"..-- Albert Einstein
"NeXTSTEP is heaven!"............................-- Me
"It just works!".................................-- Steven P. Jobs
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads