• 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: Need for Swift
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need for Swift


  • Subject: Re: Need for Swift
  • From: Richard Charles via Cocoa-dev <email@hidden>
  • Date: Tue, 15 Oct 2019 12:27:44 -0600

> On Oct 15, 2019, at 11:27 AM, Turtle Creek Software via Cocoa-dev
> <email@hidden> wrote:
>
> The basic language problem as I see it is in the headers.  Classes are
> either Obj-C or C++ and can't be both.  It turned out to be an enormous
> barrier that caused all sorts of pains.

From older documentation.

"The class hierarchies are separate; a C++ class cannot inherit from an
Objective-C class, and an Objective-C class cannot inherit from a C++ class."

This may or may not help. I use the following inline macro for C++ prototypes
in dual purpose headers.

#ifdef __cplusplus
#define CPP(x) x
#else
#define CPP(x)
#endif

That way you can import or include the same header into a .m or .mm source file.

--Richard Charles

_______________________________________________

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: Need for Swift (From: Turtle Creek Software via Cocoa-dev <email@hidden>)
 >Re: Need for Swift (From: Jens Alfke via Cocoa-dev <email@hidden>)
 >Re: Need for Swift (From: Turtle Creek Software via Cocoa-dev <email@hidden>)

  • Prev by Date: Re: Need for Swift
  • Next by Date: Re: Need for Swift
  • Previous by thread: Re: Need for Swift
  • Next by thread: Re: Need for Swift
  • Index(es):
    • Date
    • Thread