discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Summary: Where is object_setInstanceVariable() in GNUstep?


From: Richard Frith-Macdonald
Subject: Re: Summary: Where is object_setInstanceVariable() in GNUstep?
Date: Sat, 30 Nov 2002 18:41:29 +0000

On Saturday, November 30, 2002, at 05:55  pm, Andreas Hoeschler wrote:

Hi all,

I just found NSObjcRuntime.h and do

#ifdef __APPLE__
(void)object_setInstanceVariable(controllerObject, [aspect cString], targetCarrier);
#else
(void)GSSetInstanceVariable(controllerObject, aspect, targetCarrier);
#endif

now. Could not test if this works. At least the compiler does not complain anymore.


I'm pretty sure that GSSetInstanceVariable() will have been marked as deprecated in whatever version of GNUstep you were looking at.
It does not exist in the current version in CVS,

What you want is the safer solution of using GSObjCFindVariable() and then GSObjCSetVariable() in the latest CVS code, since GSObjCFindVariable() provides type information you can use to ensure that you are not trying to set an incorrectly typed value into an instance variable.

These function are now present in GSObjCRuntime.m in the Additions subproject of the base library, where the idea is that people can port the Additions code to other systems (like Darwin) so a common set of additional facilities (including runtime functions) can be used on all systems.

You build a standalone 'additions' library by doing a 'make add=yes' and can refrain from building the main base library (eg if you want to use apples Foundation) by using 'make add=yes base=no'

NB. nobody has actually ported this library yet ... so this is really just a nice idea to make portability easier in future /// though I'm happy to help out if anyone does port it, and to incorporate portability change into the GNUstep CVS for people.






reply via email to

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