• 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: Cocoa from C++ (dont want to mix it)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa from C++ (dont want to mix it)


  • Subject: Re: Cocoa from C++ (dont want to mix it)
  • From: Andrew White <email@hidden>
  • Date: Fri, 11 Mar 2005 09:31:10 +1100


Dominik wrote:
I did a search on google and DONT want to mix C++ and ObjectC but to replace it.

Assumption: You're using objective-C because you want to write for Mac OS X Cocoa.


Firstly, in XCode, if you change a file extension from .m to .mm then the compiler will use Objective-C++ to compile your code. At this point, you can mix C++ classes and objective C, subject to the normal differences between the two languages.

If you want to write to Cocoa using C++ APIs then you could implement an opaque C++ wrapper for the entire AppKit, but this strikes me as an enormous amount of work for very little gain. What might be worthwhile is glue code for a few carefully selected operations, if you have a existing C/C++ code that you wish to interface with Cocoa.

Finally, Carbon is C (and thus C++) compatible.


[object message] may look like object->message (), but it's actually quite a bit more sophisticated in implementation. You can't just replace one with the other at the linker level.


--
Andrew White

--------------------------------------------------------------------------
This email and any attachments are confidential. They may contain legally
privileged information or copyright material. You should not read, copy,
use or disclose them without authorisation. If you are not an intended
recipient, please contact us at once by return email and then delete both
messages. We do not accept liability in connection with computer virus,
data corruption, delay, interruption, unauthorised access or unauthorised
amendment. This notice should not be removed.
_______________________________________________
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


References: 
 >Cocoa from C++ (From: Dominik <email@hidden>)
 >Re: Cocoa from C++ (From: j o a r <email@hidden>)
 >Re: Cocoa from C++ (dont want to mix it) (From: Dominik <email@hidden>)

  • Prev by Date: Re: Asymmetrical behavior in NSMutableArray
  • Next by Date: AuthorizationRef, AuthorizationCopyRights, with less user interaction
  • Previous by thread: Re: Cocoa from C++ (dont want to mix it)
  • Next by thread: Re: Cocoa from C++
  • Index(es):
    • Date
    • Thread