• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: List Object's methods using class_nextMethodList Problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: List Object's methods using class_nextMethodList Problem


  • Subject: Re: List Object's methods using class_nextMethodList Problem
  • From: Michael Babin <email@hidden>
  • Date: Wed, 17 Oct 2007 14:01:20 -0500

On Oct 17, 2007, at 1:19 PM, colela wrote:

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.

You are, of course, including/importing the header file that defines objc_method_list, correct?


#import <objc/objc-class.h>

- Mike


_______________________________________________

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


References: 
 >List Object's methods using class_nextMethodList Problem (From: colela <email@hidden>)

  • Prev by Date: List Object's methods using class_nextMethodList Problem
  • Next by Date: Re: List Object's methods using class_nextMethodList Problem
  • Previous by thread: List Object's methods using class_nextMethodList Problem
  • Next by thread: Re: List Object's methods using class_nextMethodList Problem
  • Index(es):
    • Date
    • Thread