The OS X platform code for Firefox is written in Objective-C++. It's not without issues, but overall it's a nice way to use Objective-C from within a larger C++ code base. I didn't find it difficult to work with, particularly as opposed to what we'd have to do if Objective-C++ didn't exist.
If you want to see what this looks like, look at the .mm files here:
Basically what you're looking for is being able to make Obj-C calls (e.g. [[ChildView alloc] initWithFrame:r geckoChild:this]) from within what is otherwise normal C++, and vice-versa.
It’s really great when you need to call ObjC APIs from C++ or vice versa.
For the most part you can keep things as regular C++ and then just mix in some ObjC APIs when needed without splitting out your files and targets.
It’s extra useful because macOS provides a lot of really great utility libraries like dealing with media or networking, which means you can greatly reduce your dependency count on Apple platforms.
I try and take the approach of reducing dependencies in favour of platform native APIs where possible when making multi platform code, and this is great for that.
Of course it means you have different details on each platform, but I find it much more pleasant than having to keep building dependencies, and dealing with all the corresponding issues like security, size or dealing with platform specific acceleration.
> I try and take the approach of reducing dependencies in favour of platform native APIs where possible when making multi platform code, and this is great for that.
Objective-C is a superset of C, and Objective-C++ extends that to C++. It's really only meant as a shim layer to bridge C++ libraries with Objective-C. Or at least, that was the case in the pre-Swift days.
You're talking to someone that has hold NeXT manuals for an university porting project, and in fact the very first editions of Apple documentation have exactly the very same manual, rebranded for Apple.
And just not to be a random dude in the Internet, here are the NeXT documents straight out of 1993, page 173.
[1] https://en.wikipedia.org/wiki/Objective-C#Objective-C++