NSObject
Extensions
NSObject extensions for Nu programming.
Declared in: nu/nibtools.nu, objc/extensions.h, nu/nu.nu, objc/object.h
Methods
| + |
(NSArray *) |
classMethodNames |
Get an array containing the names of the class methods of a class.
in objc/object.h
| + |
(NSArray *) |
classMethods |
Get an array containing NuMethod representations of the class methods of a class.
in objc/object.h
| + |
(BOOL) |
copyInstanceMethod: |
(NSString *) methodName |
|
fromClass: |
(NuClass *) prototypeClass |
Copy a named instance method from another class to the receiving class.
in objc/object.h
| + |
(id) |
createSubclassNamed: |
(NSString *) subclassName |
Create a subclass of a class with the specified name.
in objc/object.h
| + |
(BOOL) |
exchangeClassMethod: |
(SEL) sel1 |
|
withMethod: |
(SEL) sel2 |
Swap a pair of class methods of the underlying class.
in objc/object.h
| + |
(BOOL) |
exchangeInstanceMethod: |
(SEL) sel1 |
|
withMethod: |
(SEL) sel2 |
Swap a pair of instance methods of the underlying class.
in objc/object.h
| + |
(BOOL) |
include: |
(NuClass *) prototypeClass |
Copy all of the instance methods from a specified class to the receiving class.
in objc/object.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/object.h
| + |
(NSArray *) |
instanceMethodNames |
Get an array containing the names of the instance methods of a class.
in objc/object.h
| + |
(NSArray *) |
instanceMethods |
Get an array containing NuMethod representations of the instance methods of a class.
in objc/object.h
| + |
(NSArray *) |
instanceVariableNames |
Get an array containing the names of all instance variables of the class.
in objc/object.h
| + |
(NSMethodSignature *) |
methodSignatureForSelector: |
(SEL) aSelector |
in objc/extensions.h
| + |
readFromPropertyList: |
name |
Read objects from property lists
in nu/nu.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
Returns true. In Nu, virtually all Objective-C classes are considered atoms.
in objc/object.h
Get the children of an object. By default, NSObjects have no children.
in nu/nibtools.nu
| - |
(id) |
evalWithArguments: |
(id) cdr |
|
context: |
(NSMutableDictionary *) context |
Evaluate a list with the receiving object at the head. Calls
sendMessage:withContext:
in objc/object.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/object.h
| - |
(id) |
handleUnknownMessage: |
(id) cdr |
|
withContext: |
(NSMutableDictionary *) context |
Handle an unknown message. Override this in subclasses to provide dynamic method handling.
in objc/object.h
Get a string providing a helpful description of an object.
This method should be overridden by subclasses to be more helpful.
in objc/object.h
| - |
writeToPropertyList: |
name |
Write objects as XML property lists (only for NSData, NSString, NSNumber, NSDate, NSArray, and NSDictionary objects)
in nu/nu.nu
| - |
(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) |
sendMessage: |
(id) cdr |
|
withContext: |
(NSMutableDictionary *) context |
Send a message to an object with an execution context
in objc/object.h
| - |
(id) |
set: |
(NuCell *) propertyList |
Concisely set key-value pairs from a property list.
in objc/object.h
| - |
(void) |
setValue: |
(id) value |
|
forIvar: |
(NSString *) name |
Sets the value of a specified instance variable.
in objc/object.h
| - |
(id) |
valueForIvar: |
(NSString *) name |
Gets the value of a specified instance variable.
in objc/object.h