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

Re: Multiple Inheritence (Was: Is _objc_flush_caches_(Class) necessary to swizzle methods?)


  • Subject: Re: Multiple Inheritence (Was: Is _objc_flush_caches_(Class) necessary to swizzle methods?)
  • From: DumberThanDanQuayle <email@hidden>
  • Date: Sat, 25 Sep 2004 11:06:00 -0400

On Sep 25, 2004, at 10:36 AM, Ondra Cada wrote:


On 25.9.2004, at 5:32, DumberThanDanQuayle wrote:

The idea presented in the code snippet above, that is writing individual method or whole protocol implementations in a separate file and the using the C preprocessor "#include" directives to insert that text into class definitions where need, seems to work very well and has no serious drawbacks

Well, depends on what "serious" means. You get one code at multiple places. If you put a breakpoint there, it would work for one class only, not for the other ones.

Ondra, I just tested this technique in the debugger by setting a break point and it actually works. The protocol method source is actually displayed as a normal file, which frankly was beyond my original expectations. But as you predicted it seems to work only for one class. Why is this? Would setting a break point in normal code allow me to "step" into the "#include" code for all the classes?


To change somewhat the behaviour in future without recompilation (using techniques like poseAsClassing or categories) would be quite on the ugly side.

Why would "#include" code be treated differently then normal code is these cases? I would assume that the compilation warnings and debugger functions would be more liimted with "#define," but that the Obj-C runtime would treat "#define" code as normal code to the extent that you are suggesting "#include" code would be handled differently. Can you comment on the use of "#define" versus "#include" in a technique like this?


_______________________________________________
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: Multiple Inheritence (Was: Is _objc_flush_caches_(Class) necessary to swizzle methods?)
      • From: Ondra Cada <email@hidden>
References: 
 >Is _objc_flush_caches_(Class) necessary to swizzle methods? (From: DumberThanDanQuayle <email@hidden>)
 >Re: Is _objc_flush_caches_(Class) necessary to swizzle methods? (From: Glenn Andreas <email@hidden>)
 >Re: Is _objc_flush_caches_(Class) necessary to swizzle methods? (From: DumberThanDanQuayle <email@hidden>)
 >Re: Is _objc_flush_caches_(Class) necessary to swizzle methods? (From: Glenn Andreas <email@hidden>)
 >Multiple Inheritence (Was: Is _objc_flush_caches_(Class) necessary to swizzle methods?) (From: DumberThanDanQuayle <email@hidden>)
 >Re: Multiple Inheritence (Was: Is _objc_flush_caches_(Class) necessary to swizzle methods?) (From: Ondra Cada <email@hidden>)
 >Re: Multiple Inheritence (Was: Is _objc_flush_caches_(Class) necessary to swizzle methods?) (From: DumberThanDanQuayle <email@hidden>)
 >Re: Multiple Inheritence (Was: Is _objc_flush_caches_(Class) necessary to swizzle methods?) (From: Ondra Cada <email@hidden>)

  • Prev by Date: Re: _validateBundleSecurity, _NSIsInsecureBundle, and dirIsRootUnsafe
  • Next by Date: Re: How to draw a rectangle in a NSView
  • Previous by thread: Re: Multiple Inheritence (Was: Is _objc_flush_caches_(Class) necessary to swizzle methods?)
  • Next by thread: Re: Multiple Inheritence (Was: Is _objc_flush_caches_(Class) necessary to swizzle methods?)
  • Index(es):
    • Date
    • Thread