discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Callbacks


From: Richard Frith-Macdonald
Subject: Re: Callbacks
Date: Mon, 3 Mar 2003 10:07:11 +0000


On Monday, March 3, 2003, at 12:17  am, Philip Mötteli wrote:

Hi


I have the problem, that a framework, that I have to port to Linux/Gnustep, makes use of Apples CoreFoundation library. Actually only one feature of the CoreFoundation is used: Callbacks. Those are all these methods, that are called when we insert an object into a collection object: -retain, -release and -copy. So with CoreFoundation one can define, which method in which case should be called. E. g., the "copy-case" could actually call a -retain instead of the default -copy. Is there any way, to achieve that in Gnustep? Shall we rewrite those classes to be compatible to that behaviour? I mean it's usefull, but it's not object oriented in the case of Apple's CoreFoundation library.

We don't implement CoreFoundation, but perhaps what you want to do is use NSMapTable ... that has the sort of functionality you are looking for. NB. using retain rather than copy is dangerous, because a mutable object could change its hash... making it impossible to find/remove it from the collection in the normal way... use with care.





reply via email to

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