discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Wrapping C functions


From: Martin Kalbfuß
Subject: Re: Wrapping C functions
Date: Thu, 6 Aug 2009 12:56:10 -0700 (PDT)

Thank you David. That helped a lot. I decided to have a global library object
created with load.
But how to release it? Currently I set an atexit function in the load method
which calls the release method of the class. But is there an Objective-C
way?

Another point is that I want to forbid the instanciation of the class. I
think a singleton is the right way to go. But how can I create a singleton,
when I cannot hide methods?


David Chisnall wrote:
> 
> On 6 Aug 2009, at 18:24, Martin Kalbfuß wrote:
> 
>>
>> Is the initalize method called automatically or has the user to call  
>> it?
> 
> It's called automatically by the runtime.  There is also a +load  
> method that is called when the class is loaded, but this is generally  
> not safe because there are no guarantees made about library load  
> order, so +load may be called before other libraries are loaded so  
> should be avoided unless absolutely required.
> 
> David
> 
> _______________________________________________
> Discuss-gnustep mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/discuss-gnustep
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Wrapping-C-functions-tp24850281p24853276.html
Sent from the GNUstep - General mailing list archive at Nabble.com.





reply via email to

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