78 - (id)performSelector:(
SEL)aSelector;
79 - (id)performSelector:(
SEL)aSelector withObject:(
id)object;
80 - (id)performSelector:(
SEL)aSelector withObject:(
id)object1 withObject:(
id)object2;
84 - (BOOL)isKindOfClass:(Class)aClass;
85 - (BOOL)isMemberOfClass:(Class)aClass;
86 - (BOOL)conformsToProtocol:(Protocol)aProtocol;
88 - (BOOL)respondsToSelector:(
SEL)aSelector;
98 - (void)encodeWithCoder:(
CPCoder)aCoder;
99 - (id)initWithCoder:(
CPCoder)aDecoder;
123 return [[
self alloc] init];
132 return class_createInstance(
self);
135 + (id)allocWithCoder:(
CPCoder)aCoder
196 return self.super_class;
203 + (BOOL)isSubclassOfClass:(Class)aClass
207 for (; theClass; theClass = theClass.super_class)
208 if (theClass === aClass)
218 - (BOOL)isKindOfClass:(Class)aClass
220 return [isa isSubclassOfClass:aClass];
223 + (BOOL)isKindOfClass:(Class)aClass
225 return [
self isSubclassOfClass:aClass];
232 - (BOOL)isMemberOfClass:(Class)aClass
234 return self.isa === aClass;
237 + (BOOL)isMemberOfClass:(Class)aClass
239 return self === aClass;
257 + (BOOL)instancesRespondToSelector:(
SEL)aSelector
259 return !!class_getInstanceMethod(
self, aSelector);
267 - (BOOL)respondsToSelector:(
SEL)aSelector
270 return !!class_getInstanceMethod(
isa, aSelector);
278 + (BOOL)instancesImplementSelector:(
SEL)aSelector
280 var methods = class_copyMethodList(
self),
281 count = methods.length;
284 if (method_getName(methods[count]) === aSelector)
295 - (BOOL)implementsSelector:(
SEL)aSelector
297 return [[
self class] instancesImplementSelector:aSelector];
305 + (BOOL)conformsToProtocol:(Protocol)aProtocol
307 return class_conformsToProtocol(
self, aProtocol);
315 - (BOOL)conformsToProtocol:(Protocol)aProtocol
317 return class_conformsToProtocol(
isa, aProtocol);
327 - (IMP)methodForSelector:(
SEL)aSelector
329 return class_getMethodImplementation(
isa, aSelector);
337 + (IMP)instanceMethodForSelector:(
SEL)aSelector
339 return class_getMethodImplementation(
self, aSelector);
347 - (CPMethodSignature)methodSignatureForSelector:(
SEL)aSelector
364 return class_getName(
self.
isa);
373 - (id)performSelector:(
SEL)aSelector
375 return self.isa.objj_msgSend0(
self, aSelector);
384 - (id)performSelector:(
SEL)aSelector withObject:(
id)anObject
386 return self.isa.objj_msgSend1(
self, aSelector, anObject);
396 - (id)performSelector:(
SEL)aSelector withObject:(
id)anObject withObject:(
id)anotherObject
398 return self.isa.objj_msgSend2(
self, aSelector, anObject, anotherObject);
407 - (id)performSelector:(
SEL)aSelector withObjects:(
id)anObject, ...
409 var params = [
self, aSelector].concat(Array.prototype.slice.apply(arguments, [3]));
410 return objj_msgSend.apply(
this, params);
413 - (id)forwardingTargetForSelector:(
SEL)aSelector
436 - (void)doesNotRecognizeSelector:(
SEL)aSelector
439 (class_isMetaClass(isa) ? "+" : "-") + " [" + [
self className] + " " + aSelector + "] unrecognized selector sent to " +
452 - (id)awakeAfterUsingCoder:(
CPCoder)aCoder
480 - (id)replacementObjectForArchiver:(CPArchiver)anArchiver
500 - (id)replacementObjectForCoder:(
CPCoder)aCoder
509 + (void)setVersion:(
int)aVersion
511 class_setVersion(
self, aVersion);
519 return class_getVersion(
self);
553 if (typeof
self._UID ===
"undefined")
554 self._UID = objj_generateObjectUID();
556 return self._UID +
"";
565 return self === anObject || [
self UID] === [anObject UID];
597 return isa.super_class;
604 if (anObject === nil)
607 if (anObject === undefined)
610 if (anObject === window)
613 if (maximumRecursionDepth === 0)
618 if ([anObject isKindOfClass:
CPString])
619 return '@"' + [anObject description] +
'"';
621 if ([anObject respondsToSelector:
@selector(_descriptionWithMaximumDepth:)])
622 return [anObject _descriptionWithMaximumDepth:maximumRecursionDepth !== undefined ? maximumRecursionDepth - 1 : maximumRecursionDepth];
624 return [anObject description];
627 if (typeof(anObject) !==
"object")
628 return String(anObject);
633 for (var property in anObject)
634 if (anObject.hasOwnProperty(property))
635 properties.push(property);
639 if (properties.length === 2 && anObject.hasOwnProperty(
"width") && anObject.hasOwnProperty(
"height"))
640 desc = [
CPString stringWithFormat:
@"CGSize: (%f, %f)", anObject.width, anObject.height];
641 else if (properties.length === 2 && anObject.hasOwnProperty(
"x") && anObject.hasOwnProperty(
"y"))
642 desc = [
CPString stringWithFormat:
@"CGPoint: (%f, %f)", anObject.x, anObject.y];
643 else if (properties.length === 2 && anObject.hasOwnProperty(
"origin") && anObject.hasOwnProperty(
"size"))
644 desc = [
CPString stringWithFormat:
@"CGRect: (%f, %f), (%f, %f)", anObject.origin.x, anObject.origin.y, anObject.size.width, anObject.size.height];
645 else if (properties.length === 4 && anObject.hasOwnProperty(
"top") && anObject.hasOwnProperty(
"right") && anObject.hasOwnProperty(
"bottom") && anObject.hasOwnProperty(
"left"))
646 desc = [
CPString stringWithFormat:
@"CGInset: { top:%f, right:%f, bottom:%f, left:%f }", anObject.top, anObject.right, anObject.bottom, anObject.left];
651 for (var i = 0; i < properties.length; ++i)
656 var value = anObject[properties[i]],
657 valueDescription =
CPDescriptionOfObject(value, maximumRecursionDepth !== undefined ? maximumRecursionDepth - 1 : maximumRecursionDepth).split(
"\n").join(
"\n ");
659 desc +=
" " + properties[i] +
": " + valueDescription;
661 if (i < properties.length - 1)
void doesNotRecognizeSelector:(SEL aSelector)
Used to implement exception handling (creating & raising).
function CPDescriptionOfObject(anObject, maximumRecursionDepth)
void raise:reason:(CPString aName, [reason] CPString aReason)
CPInvalidArgumentException
An object representation of a message.
Implements keyed archiving of object graphs (e.g. for storing data).
An immutable string (collection of characters).
if(CPFeatureIsCompatible(CPHTMLCanvasFeature))
Class classForKeyedArchiver()
id stringWithHash:(unsigned aHash)
Defines methods for use when archiving & restoring (enc/decoding).
id replacementObjectForCoder:(CPCoder aCoder)
FrameUpdater prototype description