• 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: Toll-free bridge type at runtime
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Toll-free bridge type at runtime


  • Subject: Re: Toll-free bridge type at runtime
  • From: Ryan Joseph <email@hidden>
  • Date: Fri, 3 Apr 2009 10:22:45 +0700


On Apr 3, 2009, at 10:11 AM, Michael Ash wrote:

The wrapper is simply a Pascal object that encapsulates a Cocoa object. The
underlying object is exactly the same as it appears in Cocoa, except it's
accessed via Objective-C runtime functions. The fact it's a "wrapper" is
really not important, I will be testing a CF type or the underlying Cocoa
object.


I'm prepared to abandon this if it's going to dangerous, it would just be
nice if users didn't have to choose manually. Thanks.

I'm not sure what you mean by a "wrapper" here. Is this just a custom Objective-C class? If so, then you can just test using Objective-C introspection methods, like -isKindOfClass:

if([array isKindOfClass:[YourPascalWrapperClass class]])
   ...it's your wrapper...
else
   ...don't do anything funny...

The "wrapper" is a Pascal class that controls an Objective-C object, so we can't use introspection on it. The plan was to determine if a pointer was a CFType then use it directly with the Objective-C runtime, otherwise dereference it to get the Objective-C object and use that instead. This is all a measure so users don't have to make this choice themselves. If I could differentiate a Pascal object from a plain Pointer it would serve the same purpose but I thought a NSArray and CFArray were testable. I think it's safe to say this test can not be performed based on what Greg Parker said.



Regards, Josef

_______________________________________________

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: 
 >Re: Toll-free bridge type at runtime (From: Greg Guerin <email@hidden>)
 >Re: Toll-free bridge type at runtime (From: Ali Ozer <email@hidden>)
 >Re: Toll-free bridge type at runtime (From: Ryan Joseph <email@hidden>)
 >Re: Toll-free bridge type at runtime (From: Mark Ritchie <email@hidden>)
 >Re: Toll-free bridge type at runtime (From: Ryan Joseph <email@hidden>)
 >Re: Toll-free bridge type at runtime (From: Michael Ash <email@hidden>)

  • Prev by Date: Re: How to animate the drawing of UIImages inside a drawRect: method of a UIView?
  • Next by Date: Re: core data, opening a previously saved xml file... bug/glitch/unexpected behavior
  • Previous by thread: Re: Toll-free bridge type at runtime
  • Next by thread: Re: Toll-free bridge type at runtime
  • Index(es):
    • Date
    • Thread