Odd stuff with Cocoa-Java
Odd stuff with Cocoa-Java
- Subject: Odd stuff with Cocoa-Java
- From: David McCabe <email@hidden>
- Date: Sun, 30 Sep 2001 14:08:56 -0700
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Greetings,
I'm brand new to Cocoa ( and also quite new to Java ). My first project
(apart from the 'Temp Converter' tutorial) has been an 'egg timer' app
which asks the user for a number of minutes to wait and then displays a
dialog after the given number of minutes.
Simple, right? I wouldn't have such luck.
The app compiled fine. But then, while it was still bouncing in the
Dock, it died. PB's 'run' console displayed:
Sep 30 13:09:21 EggTime[710] AppKitJava: uncaught exception
NSArchiverArchiveInconsistency (*** file inconsistency: read '@',
expecting 'C')
Sep 30 13:09:21 EggTime[710] AppKitJava: exception = *** file
inconsistency: read '@', expecting 'C'
Sep 30 13:09:21 EggTime[710] AppKitJava: terminating.
EggTime.app has exited with status 1.
Weird stuff. After talking about it with a friend for a while (he knows
Java, but not Cocoa), I tried recreating the project and copying the
.java and .nib files. The same error again. I tried removing and then
rewriting the main controller class. Still the same error. I tried
deleting the NIB file and making a new one. The project worked fine with
a blank NIB file (containing the default menu and window). So I set out
to recreate the NIB file. Then it didn't work again. I finally figured
out that subclassing NSTextField (which I was going to make to only
accept numbers) causes the error.
So I took that part out. Everything working great. Accept that the timer
didn't go off. The debugger kept complaining about a null pointer
exception on such and such a line, but when I put in a try/catch block
to catch it, it didn't happen anymore.
I've uploaded the source code (rewrite 3) to
<
http://homepage.mac.com/davidmccabe/eggtime.tar.gz>.
- --
David McCabe
http://homepage.mac.com/davidmccabe/
'finger email@hidden' for PGP key.
Wrfhf ybirf lbh!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (Darwin)
Comment: For info see
http://www.gnupg.org
iD8DBQE7t4nuCwKQ8Z46eHoRArfAAKC+HIrSNvupGRS+bhKEJ7fh6tCx1ACbBWOW
+jwbCgsELGUjXQJ5l7S9c1Q=
=Cxrm
-----END PGP SIGNATURE-----