Copyright ã 1994 by Guus C. Bloemsma

COWS
Object Library
COWS Version 1.4
Guus C. Bloemsma
May 29, 1994

The COWS Object Library provides one function that allows direct control of Objective-C objects. The Object Library is still experimental and liable to change.

General workings and restrictions

The Object Library allows sending a message to any object. Any Objective-C message can be sent as long as it doesn't use reference parameters or composite types (arrays or structures).

Types

The following Objective-C types are supported as value parameters or result:

	- unsigned or signed char, short, int or long
	- char*
	- id
	- class
	- selector

When passing char*, make sure that the message doesn't change the pointed-to string. This might confuse COWS, or even crash the whole application.
A char is interpreted as a truth value.

Literal data

When passing id, class or SEL values, you can simply use a string that holds the name of the selector or class. Where an id is expected, the name is converted using NXGetNamedObject() with NXApp as the owner. See Digital Librarian for details of NXGetNamedObject().
A number is cast to a pointer to the object, class or selector. This allows you to pass NULL as 0. This doesn't make sense for classes or selectors of course.
As a special case, the object the message is sent to, is first assumed to be an id. If this is not the case it is taken to be a class.
Hint: make sure that .nib files are loaded with withNames:YES.

Results

Return values of type id, class or SEL are stored as numbers and, therefore, will print as such. They can be used, though, as parameters to subsequent Objective-C messages.

Object Library Function Name

to	Sends the Objective-C message to object-or-class passing 0 or more parameters and returning the result of the message. 	(to object-or-class message parameters¼)