• 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: Runtime question - Special requirements to register overridden methods?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Runtime question - Special requirements to register overridden methods?


  • Subject: Re: Runtime question - Special requirements to register overridden methods?
  • From: Ben Dougall <email@hidden>
  • Date: Tue, 1 Jul 2003 18:02:05 +0100

there's some talk about the objc_method structure, not sure if it's more than what you've already got, in 'cocoa programming' in appendix a, if you have access to that.


On Tuesday, July 1, 2003, at 12:42 pm, Sherm Pendley wrote:

Here's the situation:

I write and maintain a "foreign" language bridge. The code for that bridge creates and registers a number of classes with the Objective-C runtime. Classes are (seemingly) registered correctly. I can create and initialize instances of them, and messages sent to them (from either end of the bridge) result in the correct calls to my implementation function.

With one exception, that is. Inherited methods are correctly sent to the super class, and new methods that don't exist in the super class are correctly called in my new sub class. But, super class methods that are overridden in my sub class aren't called when I message them from Objective-C - no call is ever made to the registered implementation function in that case.

I have gone over and over the registered class structure, both before it's sent to objc_addClass() and when it's returned from objc_getClass(), with no luck. I've tried registering the method list along with the class, and adding it later with class_addMethods(), with the same result either way.

The one example I've been able to find, in Apple's "The Objective-C Programming Language," is of no help; it leaves the method lists empty, with the comment "We can add methods later." Unfortunately, "later" never seems to arrive - the class_addMethods() function has only a terse description and no example code.

Can anyone point me to a better example of registering a class, including methods - preferably, methods that override those in the super class? Is there any special magic required to register such methods, beyond the basic selector, signature, IMP information?

sherm--

"I have no special gift, I am only passionately curious." - Albert Einstein
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Runtime question - Special requirements to register overridden methods? (From: Sherm Pendley <email@hidden>)

  • Prev by Date: Re: Strong language about Cocoa and Qt.
  • Next by Date: Re: Strong language about Cocoa and Qt.
  • Previous by thread: Runtime question - Special requirements to register overridden methods?
  • Next by thread: Re: NSOpenGLView. How does it work?
  • Index(es):
    • Date
    • Thread