Nu Class Reference

NuPointer

The Nu pointer wrapper.

Superclass: NSObject
Declared in: objc/Nu.h

The NuPointer class provides a wrapper for pointers to arbitrary locations in memory.

Methods

- (id) save
The NuReference class provides a wrapper for pointers to Objective-C objects. NuReference objects are used in the Nu language to capture arguments that are returned by value from Objective-C methods. For example, the following Nu method uses a NuReference to capture a returned-by-reference NSError:

(- (id) save is
  (set perror ((NuReference alloc) init))
  (set result ((self managedObjectContext) save:perror))
  (unless result
    (NSLog "error: #{((perror value) localizedDescription)}"))
  result)


in objc/Nu.h

- (void) allocateSpaceForTypeString: (NSString *) s
Helper function, used internally to reserve space for data of a specified type.

in objc/Nu.h

- (id) value
Get the value of the pointed-to object, using the typeString to determine the correct type

in objc/Nu.h

- (id) object
Assume the pointer is a pointer to an Objective-C object. Get the object. You had better be right, or this will crash.

in objc/Nu.h

- (NSString *) typeString
Get an Objective-C type string describing the pointer target.

in objc/Nu.h

- (void) setTypeString: (NSString *) typeString
Set the type of a pointer. This should be an Objective-C type encoding that begins with a "^".

in objc/Nu.h

- (void) setPointer: (void *) pointer
Set the pointer. Used by the bridge to create NuReference objects from pointers. Don't call this from Nu.

in objc/Nu.h

- (void *) pointer
Get the value of the pointer. Don't call this from Nu.

in objc/Nu.h