JGMethodSwizzler icon indicating copy to clipboard operation
JGMethodSwizzler copied to clipboard

Swizzling an instance method on the same instance twice causes it be to applied to all instances.

Open chrislconover opened this issue 10 years ago • 1 comments

Description:

  • Swizzling an instance method on an instance twice (or at least more than once) causes the swizzling to be applied to all instances of the instance/object class.

Expected behavior:

  • Overwrite existing method.

Notes:

  • I realize that the above sequence is ill advised, but discovered the issue during prototyping.
  • For all it's worth, the REKit project has decent semantics, though buggy. Your syntax for defining overrides and calling the base implementation is much cleaner though.
  • One nice feature to have (unless I missed it), is to be able to simply inject a new method altogether, without swizzling to another, per se.

Thanks, and great library!

chrislconover avatar May 06 '14 22:05 chrislconover

I'll check this out once I have time. Could you fork the repo and fix it yourself, then send a pull request? That would be great help!

JonasGessner avatar Aug 05 '14 19:08 JonasGessner