Contents (package MULK.OBJECTIVE-CL)


Standard Generic Function OBJECTIVE-C-CLASS-REGISTERED-P

Purpose:

Determine whether a class has been registered with the Objective-C runtime.

Syntax:

objective-c-class-registered-p class

Arguments and Values:

class --- an object of type objective-c-class.

Returns: a boolean.

Description:

objective-c-class-registered-p determines whether class has been registered with the Objective-C runtime. It is the only public API provided by the class objective-c-class.

A class is registered automatically when an instance is first seen by Objective-CL or when an attempt is made to send a message to it or its metaclass.

The effect of attempting to add methods to registered classes is undefined. Portable programs should therefore avoid it, even though it may work reliably on some systems (where it can be useful for debugging and development for portable programs as well).

Examples:

(define-objective-c-class mlk-my-class ()  
    ((foos :initargs :foos)  
     (foo-count :foreign-type :int)))  ;"fooCount" on the foreign side  
  => #<NS:+MLK-MY-CLASS NS:MLK-MY-CLASS {8080BF8}>  
  
(objective-c-class-registered-p (find-objc-class 'mlk-my-class))  
  => NIL  
  
(invoke (find-objc-class 'mlk-my-class) 'new)  
  => #<NS:MLK-MY-CLASS `<MLKMyClass: 0x81de1f8>' {81DE1F8}>  
  
(objective-c-class-registered-p (find-objc-class 'mlk-my-class))  
  => T