How well is Objective-C ++ supported?

I studied Objective-C and Cocoa through a Hillegass book , and it occurs to me that I can use Objective-C ++ better. Objective-C seems like a clear choice for developing user interfaces, but I have a very strong background in C ++, and I would like to develop images of applications in C ++ and use Objective-C ++ to integrate with the user interface. But I wonder if Apple will continue to develop Objective-C ++ or whether it will become a dead end.

Is there anyone using Objective-C ++?

+33
cocoa objective-c ++
Jan 02 '09 at 13:09
source share
7 answers

Disclaimer: I do not work or speak for Apple, so this is my opinion:

I can’t talk about the main stores, but in my small group we used Objective-C ++ both to integrate C ++ libraries and to create links to C ++. As @alxp mentions, things like handling language-level exceptions are painful, but with a little planning, most of these efforts can be avoided. For experienced C ++ developers, winning can be useful for pain.

As for support, I think you can assume that support in its current state will not disappear in the near future. This is part of the GCC code base and the Clang toolchain (the next Apple compiler chain) fully supports Objective-C ++. On the other hand, there is no official guarantee that Apple will continue to develop integration, for example, of some warts.

For current projects, I would say that if using Objective-C ++ gives an advantage, then you can hope for the existing support, and you should use it.

+29
Jan 02 '09 at 16:10
source share

The only cases where I used ObjC ++ were port libraries to make them accessible from my ObjC code. The clashes between ObjC ++ and ObjC handling things like exceptions and creating and destroying classes just made too much headache to juggle two languages ​​in the same project.

I don’t think that support will disappear soon, as happened with Cocoa / Java, since it is pretty solidly included in GCC, and the fact that Objective-C ++ compiles to direct C ++ in the same way that Objective- C can compile to direct C, but I still do not think it is a very pleasant environment for creating software compared to Objective-C and the possibility of comfortable use of OS X frameworks.

+7
Jan 02 '09 at 13:46
source share

Objective-C ++ is likely to remain support as long as Objective-C. Obj-C ++ is the main goal of clang , which is expected to eventually replace gcc as the preferred Apple compiler. Usage is likely to increase as Carbon applications move to Cocoa's frontiers.

Of course, the word "probably" appears twice above because Apple is so excitingly unpredictable. :-)

+4
Jan 02 '09 at 14:01
source share

I suspect that Apple will continue to support Objective-C ++ for a while, as I do not see any significant repetitive efforts by Apple to support Objective-C ++ like updates to Apple Cocoa and Objective-C ++.

+2
Jan 02 '09 at 14:55
source share

The other day, I was surprised when I tried to reorganize some Objective-C code that was in the Objective-C ++ file using Xcode refactoring support. Despite the fact that menu items are enabled, I got the Cant refactor Objective-C ++ code. Xcode can only use C code and Objective-C. error message. Therefore, although compilation of Objective-C ++ will continue to function indefinitely, I suspect that Objective-C ++ will be a second-class citizen in Xcode.

+1
Mar 02 2018-12-12T00:
source share

I took this from all my code. No .mm files.

But you need .cpp files to work with .m files. This is a .c / .h file that preserves the integrity of the blood-brain barrier.

C ++ with objective-C is usually too much baggage.

0
Feb 28 '13 at 1:13
source share

Objective-C is just a bunch of C code that emulates C objects, and it still uses the C compiler, including Objective-C header files. Using Objective-C ++ uses the C ++ compiler and includes Objective-C headers as C code, since C ++ runs C code. Objective-C ++ is essentially just C, C ++, and Objective-C (it's really just C)

-one
Jul 03 '13 at 2:55
source share



All Articles