Re: Need for Swift
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