• 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: PoseAsClass and NSColorWell (what Apple giveth, Apple taketh away...)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PoseAsClass and NSColorWell (what Apple giveth, Apple taketh away...)


  • Subject: Re: PoseAsClass and NSColorWell (what Apple giveth, Apple taketh away...)
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Fri, 28 Mar 2008 20:00:03 +0100


Le 28 mars 08 à 13:33, Jeff Johnson a écrit :

Graham,

If you're just overriding one or two methods of NSColorPanel, you could use the technique I describe here:

http://lapcatsoftware.com/blog/2007/11/25/working-without-a-nib-part-6-working-without-a-xib/

It uses the Apple-documented function method_exchangeImplementations() in the Leopard Objective-C runtime, so it should be supported for the foreseeable future.

Note that this function might not be available in the Tiger Objective-C runtime. If you use the 10.5 SDK, that won't be a problem. If you still need to support Tiger, however, I don't really know of any 'future-proof' technique. It's highly unlikely that Apple would or could kill poseAsClass in a 10.5.x update, so it will continue to work in both Tiger and Leopard, though it's already dead in the Leopard 64-bit runtime.

You want a futur proof way on Tiger, use weak linking:

if (method_exchangeImplementations) {
// do it the Leopard way
} else {
// do it the Tiger way
}



_______________________________________________

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: 
 >PoseAsClass and NSColorWell (what Apple giveth, Apple taketh away...) (From: Graham Cox <email@hidden>)
 >Re: PoseAsClass and NSColorWell (what Apple giveth, Apple taketh away...) (From: Jeff Johnson <email@hidden>)

  • Prev by Date: Re: Cant get Garbage Collection to work
  • Next by Date: Re: Cant get Garbage Collection to work
  • Previous by thread: Re: PoseAsClass and NSColorWell (what Apple giveth, Apple taketh away...)
  • Next by thread: Re: PoseAsClass and NSColorWell (what Apple giveth, Apple taketh away...)
  • Index(es):
    • Date
    • Thread