• 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
Is _objc_flush_caches_(Class) necessary to swizzle methods?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Is _objc_flush_caches_(Class) necessary to swizzle methods?


  • Subject: Is _objc_flush_caches_(Class) necessary to swizzle methods?
  • From: DumberThanDanQuayle <email@hidden>
  • Date: Fri, 24 Sep 2004 04:47:29 -0400

<x-tad-bigger>Method swizzling code examples, specifically that in Anguish et al. in "Cocoa Programming" at page 1083 and those archived at CocoaBuilder, mention the need to call "_objc_flush_caches_(Class)" after swizzling to keep the runtime kosher.

I have tried this and found that I get some runtime strangeness while running the debugger, like specific confusion about inheritence and the states of ivars.

A page on method swizzling at CocoaDev does not mention the use of this _objc_flush_caches_(Class), so I ran my software without it and my ivar state problem appeared to go away:

http://www.cocoadev.com/index.pl?MethodSwizzling


But I have yet to rigorously test the issue.

Does anybody know what the story with "_objc_flush_caches_(Class)" and method swizzling really is?


Thanks and don't forget to vote,
George.
</x-tad-bigger>


<x-tad-bigger>"[A]s you know, these are open forums, you're able to come and listen to what I have to say."

George W. Bush
—Washington, D.C., Oct. 28, 2003
</x-tad-bigger>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Is _objc_flush_caches_(Class) necessary to swizzle methods?
      • From: Glenn Andreas <email@hidden>
  • Prev by Date: how detect easily network type (lan/modem/proxy) on mac os x?
  • Next by Date: How to extend Safari -> Context-Menu, Plugin, traps
  • Previous by thread: Re: how detect easily network type (lan/modem/proxy) on mac os x?
  • Next by thread: Re: Is _objc_flush_caches_(Class) necessary to swizzle methods?
  • Index(es):
    • Date
    • Thread