Nu Class Reference

NSObject Extensions

NSObject extensions for Nu programming.

Declared in: nu/nibtools.nu, objc/Nu.h



Methods

+ (BOOL) exchangeClassMethod: (SEL) sel1
withMethod: (SEL) sel2
Swap a pair of class methods of the underlying class.

in objc/Nu.h

+ (BOOL) exchangeInstanceMethod: (SEL) sel1
withMethod: (SEL) sel2
Swap a pair of instance methods of the underlying class.

in objc/Nu.h

+ (id) inheritedByClass: (NuClass *) newClass
This method is automatically sent to a class whenever Nu code creates a subclass of that class. Its default implementation does nothing. Override it to track subclassing.

in objc/Nu.h

+ (BOOL) include: (NuClass *) prototypeClass
Copy all of the instance methods from a specified class to the receiving class.

in objc/Nu.h

+ (BOOL) copyInstanceMethod: (NSString *) methodName
fromClass: (NuClass *) prototypeClass
Copy a named instance method from another class to the receiving class.

in objc/Nu.h

+ (id) createSubclassNamed: (NSString *) subclassName
Create a subclass of a class with the specified name.

in objc/Nu.h

+ (NSArray *) instanceVariableNames
Get an array containing the names of all instance variables of the class.

in objc/Nu.h

+ (NSArray *) instanceMethodNames
Get an array containing the names of the instance methods of a class.

in objc/Nu.h

+ (NSArray *) classMethodNames
Get an array containing the names of the class methods of a class.

in objc/Nu.h

+ (NSArray *) instanceMethods
Get an array containing NuMethod representations of the instance methods of a class.

in objc/Nu.h

+ (NSArray *) classMethods
Get an array containing NuMethod representations of the class methods of a class.

in objc/Nu.h

- (NSData *) binaryPropertyListRepresentation
Property list helper. Return the binary property list representation of the object.

in objc/Nu.h

- (NSData *) XMLPropertyListRepresentation
Property list helper. Return the XML property list representation of the object.

in objc/Nu.h

- (BOOL) hasValueForIvar: (NSString *) name
Return true if object has a value for the named instance variable.

in objc/Nu.h

- (void) removeAssociatedObjects
Remove all associated objects.

in objc/Nu.h

- (id) associatedObjectForKey: (id) key
Get the value of an associated object.

in objc/Nu.h

- (id) set: (NuCell *) propertyList
Concisely set key-value pairs from a property list.

in objc/Nu.h

- (NSString *) help
Get a string providing a helpful description of an object. This method should be overridden by subclasses to be more helpful.

in objc/Nu.h

- (id) handleUnknownMessage: (id) cdr
withContext: (NSMutableDictionary *) context
Handle an unknown message. Override this in subclasses to provide dynamic method handling.

in objc/Nu.h

- (id) evalWithArguments: (id) cdr
context: (NSMutableDictionary *) context
Evaluate a list with the receiving object at the head. Calls sendMessage:withContext:

in objc/Nu.h

- (id) sendMessage: (id) cdr
withContext: (NSMutableDictionary *) context
Send a message to an object with an execution context

in objc/Nu.h

- (void) setValue: (id) value
forIvar: (NSString *) name
Sets the value of a specified instance variable.

in objc/Nu.h

- (id) valueForIvar: (NSString *) name
Gets the value of a specified instance variable.

in objc/Nu.h

- (id) evalWithContext: (NSMutableDictionary *) context
Evaluation operator. The Nu default is for an Objective-C object to evaluate to itself, but certain subclasses (such as NuSymbol and NSString) behave differently.

in objc/Nu.h

- (bool) atom
Returns true. In Nu, virtually all Objective-C classes are considered atoms.

in objc/Nu.h

- (id) onlyMatchingChild: (id) block
Return one object from the object child-hierarchy rooted at the current object. The object must match criteria in the provided block. For example, to return the NSButton object in a specified view, use:

(myView onlyMatchingChild: (do (v) (v isKindOfClass: NSButton)))

in nu/nibtools.nu

- (id) allMatchingChildren: (id) block
Return a collection of objects from the object child-hierarchy rooted at the current object. Objects must match criteria in the provided block. For example, to return all the NSButton objects in a specified view, use:

(myView allMatchingChildren: (do (v) (v isKindOfClass: NSButton)))

in nu/nibtools.nu

- (id) children
Get the children of an object. By default, NSObjects have no children.

in nu/nibtools.nu