• 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: Qustion about possibly bad advice in NSView documentation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Qustion about possibly bad advice in NSView documentation


  • Subject: Re: Qustion about possibly bad advice in NSView documentation
  • From: Alastair Houghton <email@hidden>
  • Date: Wed, 26 Sep 2007 10:52:51 +0100

On 26 Sep 2007, at 03:29, Chris Suter wrote:

On 26/09/2007, at 11:52 AM, Scott Ribe wrote:

As for NSInvocation, obviously you can use NSInvocation to pass
arguments of pretty much any type you like.

As long as they're 8 bytes or smaller? And yes, I think that means they
won't work with NSRects either. I ran into this with some C++ integration;
solution was to pass pointers instead of values...

Unless you've encountered a bug in your specific usage, NSInvocation should work fine with passing parameters that are more than 8 bytes in size. It certainly works fine with a simple test program I just tried on my Intel Mac.

I think it's possible to cause yourself problems in C++ because of features like copy constructors and destructors. NSInvocation takes a binary copy of the parameters... it won't call the copy constructor and it won't call a destructor when it's done with the copy either. And I imagine the runtime does another binary copy when you invoke a method using an NSInvocation (again, no copy constructor call, no destructor call afterwards). My guess is that that's what Scott saw when using C++.


Kind regards,

Alastair.

--
http://alastairs-place.net


_______________________________________________

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: Qustion about possibly bad advice in NSView documentation (From: Scott Ribe <email@hidden>)
 >Re: Qustion about possibly bad advice in NSView documentation (From: Chris Suter <email@hidden>)

  • Prev by Date: Core data - getting fresh records
  • Next by Date: Re: NSTask -launch override
  • Previous by thread: Re: Qustion about possibly bad advice in NSView documentation
  • Next by thread: Re: Qustion about possibly bad advice in NSView documentation
  • Index(es):
    • Date
    • Thread