ewasylishen@gmail.com
)quentin.mathe@gmail.com
)Mirror class that represents an Objective-C instance variable.
Copyright: (C) 2009 Eric Wasylishen
- Declared in:
- ETInstanceVariableMirror.h
- Conforms to:
- ETInstanceVariableMirror
- ETCollection
@group Reflection
ETInstanceVariableMirror
implements the collection protocol to allow ivar
content to be recursively traversed when ivars are
presented in a UI inspector. For example,the
inspector can use an outline view which makes
possible to look at the "subivars" that makes up
the object which corresponds to each ivar value.
If the ivar isn't an object type, the ivar is not
traversable.
See also ETViewModelLayout
in EtoileUI.
Returns a new autoreleased instance variable mirror for the given runtime underlying representation and an optional owner mirror.
See also -initWithIvar:ownerMirror: .
Initializes and returns an instance variable mirror for the given runtime underlying representation and a owner mirror.
The owner mirror must conform to either ETClassMirror or ETObjectMirror protocols.
Returns whether the instance variable value is an object or not.
Returns the mirror representing the runtime construct where the instance variable is declared or located.
Returns the mirror representing the object where the instance variable is located and its value stored.
Will return nil
when the owner mirror
doesn't conform to ETObjectMirror protocol.
Sets the value stored in the instance variable.
If the instance variable type is a primitive type, the value cannot be set, unless the type encoding corresponds to a number or a structure such as NSRect, NSSize, NSPoint and NSRange. In this case, you can pass the primitive value boxed respectively in an NSNumber or NSValue object.
If value is an object and the instance
variable type is a primitive type, in case no
primitive value matching the
expected type can be unboxed, an
NSInvalidArgumentException is
raised.
For example, if value
is a NSString and the instance variable is a NSRect,
the exception reason will be: NSString does not
recognize the selector
-rectValue
.
Returns the underlying runtime basic type (object, int, char, struct etc.) associated with the instance variable.
These runtime basic types are encoded as character sequences. To interpret the returned value, see the runtime documentation.
Returns either class name or the type encoding name of the instance variable. The class name is returned when the value is an object, otherwise the the type encoding name is returned.
If -value
returns
nil
and the type encoding denotes an
object, take note the type encoding name is
returned since the object type can only be
looked up dynamically (by querying the object
referenced by the instance variable).
Returns the value stored in the instance variable.
If the instance variable type is a primitive type,
nil
is returned, unless the type
encoding corresponds to a number or a structure
such as NSRect, NSSize, NSPoint and NSRange. In this
case, the returned value is respectively an
NSNumber or NSValue object that boxes the
primitive value.
Returns a mirror representing the value stored in the instance variable when the value is an object.
Returns nil
when the value is a
primitive type.