• 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: Using Objective-C object in C++ source
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using Objective-C object in C++ source


  • Subject: Re: Using Objective-C object in C++ source
  • From: "K. Chen" <email@hidden>
  • Date: Thu, 14 May 2009 11:44:57 -0700

Does it mean I can write C++ code inside Objective-C program (with certain constraints) but not vice versa?

-KC

On Thu, May 14, 2009 at 10:45 AM, Andreas Grosam <email@hidden> wrote:

On May 13, 2009, at 10:40 PM, Dave Carrigan wrote:


On May 13, 2009, at 1:36 PM, K. Chen wrote:

Can a C++ program instantiate and use an Objective-C object? Can this be done in Xcode?


Yes and yes. Just give your C++ file a .mm extension and instantiate to your heart's content.

Strictly, it is a No and a No.

A "C++ program" is defined in its corresponding standard. There is no Objective-C object in C++.

What Dave meant is Objective-C++ -- which is Objective-C with the capability to include *some* C++. The Objective-C++ compiler is included in GCC and works in Xcode.

Objective-C++ is not C++, though! -Don't expect all works seamlessly. In fact there are subtle issues, and IMHO many deficiencies - although documented.


Regards
Andreas


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Using Objective-C object in C++ source
      • From: Shawn Erickson <email@hidden>
References: 
 >Using Objective-C object in C++ source (From: "K. Chen" <email@hidden>)
 >Re: Using Objective-C object in C++ source (From: Dave Carrigan <email@hidden>)
 >Re: Using Objective-C object in C++ source (From: Andreas Grosam <email@hidden>)

  • Prev by Date: Re: Link Failure
  • Next by Date: Re: Converting .plist during the build process
  • Previous by thread: Re: Using Objective-C object in C++ source
  • Next by thread: Re: Using Objective-C object in C++ source
  • Index(es):
    • Date
    • Thread