[OGo-Developer] _e_info in NSException.h

Helge Hess developer@opengroupware.org
Tue, 22 Jan 2008 15:00:26 +0100


On 14.01.2008, at 11:35, Sebastian Reitenbach wrote:
> while changing to gnustep-make 2.0 I tried to compile sope against
> gnustep-base 2.15.2. In sope there is a private variable of  
> NSException
> used: _e_info. which got replaced by _reserved.
> Therefore I asked about it on the discuss-gnustep@ mailing list.
> As it is generally a bad idea to access private methods and  
> variables of I
> thing Richard is right, and it should be changed in sope.

Hm, yes. This is because before MacOS 10.2(?) there was a public - 
setUserInfo: method. This was removed from the public headers but is  
still provided in the implementation (of Cocoa).

Now I think GNUstep removed the method completely (not just from the  
header), hence I needed to provide an own implementation (which used  
the _e_info private field ...).

> What would be the preferred way?
> Adding a general NSException(UserInfo) category?
> Or change all occurences where this happens, I think it is only one  
> place in NGImap4...

We should (carefully!) remove all calls to -setUserInfo: (check  
whether userinfo fields are required by callers etc).

> As I only see ifdefs for GNUSTEP_BASE_LIBRARY but not for Cocoa, and
> Richards test program fails on Cocoa, I wonder how is this working  
> on Cocoa?

As mentioned I think that Cocoa does not define -setUserInfo: in a  
header file, but NSException still has the method internally. Probably  
a lot of 'old' Cocoa applications depend on it.

Thanks,
   Helge
-- 
Helge Hess
http://www.helgehess.eu/