A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.lispworks.com/documentation/lw71/DV/html/delivery-139.htm below:

6.9 Retaining Objective-C classes

6.9 Retaining Objective-C classes

If you implement an Objective-C class in Lisp but its name is not referenced at run time, then you need to arrange for this symbol to be retained during delivery.

This can be achieved with :keep-symbols, but a more modular approach is to keep the name on the plist of some other symbol. For example the internal CAPI class lw-slider is defined like this:

(objc:define-objc-class lw-slider ()
    ()
  (:objc-class-name "LWSlider")
  (:objc-superclass-name "NSSlider"))

and lw-slider is retained like this:

(setf (get 'slider-representation 'owner-class)
      'lw-slider)

In this case, the code for slider-representation is the only thing that makes the LWSlider object, so it is the best place to retain it (that is, only if slider-representation is retained).

LispWorks Delivery User Guide - 10 Aug 2017


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4