bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with NSProcessInfo (?)


From: Chris B. Vetter
Subject: Re: Problem with NSProcessInfo (?)
Date: Tue, 20 May 2003 11:08:36 -0700

On Tue, 20 May 2003 19:00:39 +0100 (BST)
Nicola Pero <nicola@brainstorm.co.uk> wrote:
> > I've played around a bit (using gcc32, no gcc33 here), if +load
> > - is completely empty, it works
> > - only has plain C code, it works
> > - has any kind of ObjC code, even a simple NSLog(@"foo"), it fails.
> Which seems correct. :-)

Eh?

> A "simple NSLog ()" is not that simple I guess. :-)

"even a simple NSLog" as in "nothing fancy like messages to objects".

> It's generally better to leave +load alone - it's useful in
> exceptional cases such as NSProcessInfo, where there really is no
> other way of executing code before main ().  In those exceptional
> cases usually you're struggling with low level issues anyway, and
> using C code is Ok.

Actually, no, it's not OK.
For one thing, I know for sure that +load was working before. I've been
using it (back last year) to set the version for objects within the
framework, but later moved that to +initialize.

I found out about the +load problem, when I was trying to write a
subclass of NSWorkspace and tried to have it +poseAs: super.

To my knowledge, you need to put the +poseAs: +poseAsClass: and/or
-transmuteClassTo: calls as early as possible, so +initialize may be
"too late" as other classes may already use NSWorkspace (in this
particular case). To put those in +load seems to be the only viable
option.

-- 
Chris




reply via email to

[Prev in Thread] Current Thread [Next in Thread]