List Object's methods using class_nextMethodList Problem
List Object's methods using class_nextMethodList Problem
- Subject: List Object's methods using class_nextMethodList Problem
- From: colela <email@hidden>
- Date: Wed, 17 Oct 2007 11:19:02 -0700
I am having trouble using the suggested technique for accessing a
class' method list using class_nextMethodList.
In xCode 2.5, the following code fragment:
//method enumeration example
- (CC *)enumMethodList;
{
void *iterator = 0;
struct objc_method_list *mList;
Class theClass = [self class];
int k;
NSString *className = [theClass description];
mList = class_nextMethodList( theClass, &iterator );
while( mList != NULL )
{
/*
for(k=0; k < mList->method_count; k++)
{
NSLog(@"%@ implements %s", className, mList->method_list
[k].method_name);
}
*/
mList = class_nextMethodList( theClass, &iterator );
}
}
runs and shows the method list (mList) in the debugger and its
contents are accessible there.
When I remove the comments around the for loop, the compiler
generates 2 "dereferencing pointer to incomplete type" error
messages; 1 for the method_count reference and 1 for the method_name
reference.
The compiler settings are default except I have "Handle Objective-C
Exceptions" enabled.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden