46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
bool is_class = object_getClass(obj)->info & OBJC_CLASS_INFO_METACLASS;
if (!(object_getClass(obj)->info & OBJC_CLASS_INFO_INITIALIZED)) {
Class cls = (is_class ? (Class)obj : object_getClass(obj));
objc_initialize_class(cls);
if (!(cls->info & OBJC_CLASS_INFO_SETUP)) {
if (is_class)
return lookup(nil, sel);
else
OBJC_ERROR("Could not dispatch message for "
"incomplete class %s!", cls->name);
}
/*
* We don't need to handle the case that super was called.
* The reason for this is that a call to super is not possible
* before a message to the class has been sent and it thus has
* been initialized together with its superclasses.
*/
return lookup(obj, sel);
}
/* Try resolveClassMethod:/resolveInstanceMethod: */
if (class_isMetaClass(object_getClass(obj))) {
Class cls = object_getClass(obj);
if (class_respondsToSelector(cls,
@selector(resolveClassMethod:)) &&
[obj resolveClassMethod: sel]) {
if (!class_respondsToSelector(cls, sel))
|
|
<
<
<
|
|
<
|
|
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
bool is_class = object_getClass(obj)->info & OBJC_CLASS_INFO_METACLASS;
if (!(object_getClass(obj)->info & OBJC_CLASS_INFO_INITIALIZED)) {
Class cls = (is_class ? (Class)obj : object_getClass(obj));
objc_initialize_class(cls);
if (!(cls->info & OBJC_CLASS_INFO_SETUP))
OBJC_ERROR("Could not dispatch message for incomplete "
"class %s!", cls->name);
/*
* We don't need to handle the case that super was called.
* The reason for this is that a call to super is not possible
* before a message to the class has been sent and it thus has
* been initialized together with its superclasses.
*/
return lookup(obj, sel);
}
/* Try resolveClassMethod: / resolveInstanceMethod: */
if (class_isMetaClass(object_getClass(obj))) {
Class cls = object_getClass(obj);
if (class_respondsToSelector(cls,
@selector(resolveClassMethod:)) &&
[obj resolveClassMethod: sel]) {
if (!class_respondsToSelector(cls, sel))
|