Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How well is Objective-C++ supported?

I've been learning Objective-C and Cocoa by working my way through the Hillegass book and it occurs to me that I might be better off using Objective-C++. Objective-C seems like the clear choice for developing UIs but I have a very strong C++ background and would love to develop application back-ends in C++ and use Objective-C++ to do the UI integration. But I wonder if Apple will keep developing Objective-C++ or will it become a dead end.

Is anyone out there using Objective-C++?

like image 532
Ferruccio Avatar asked Jan 02 '09 13:01

Ferruccio


People also ask

How long will Objective-C be supported?

Once the July 31st, 2021 date is reached: No further versions and patches of the Objective-C SDK will be released. All Objective-C SDK download links on the My Workspace ONE portal will be removed or redirected to the Swift SDK download link instead.

Do people still use Objective-C?

Objective-C is so pervasive in iOS that it's impossible to completely remove it. Apple continues to maintain libraries written in Objective-C, so we should expect Objective-C to be treated as a (mostly) first class language in iOS. At other companies, legacy code remains.

Is Objective-C deprecated?

It won't be deprecated, but it'll move to Florida to enjoy its golden years. It'll spend days running the legacy app with a million lines of code, and its nights sipping margaritas with the OAuth library everyone fears rewriting.

Is Swift or Objective-C better?

Swift has better memory management features than Objective-C, which can help improve performance. It uses lazy initialization, reducing memory usage since unused variables do not initialize—making it faster, easier to read and write, and safer.


1 Answers

Disclaimer: I don't work or speak for Apple, so this is my opinion:

I can't speak for the major dev shops, but in my small group, we've used Objective-C++ both for integrating C++ libraries, and as you propose for writing backends in C++. As @alxp mentions, things like exception handling across the language boundary are painful, but with a little planning, most of these pains can be avoided. For experienced C++ devs, the gains can be well worth the pain.

In terms of support, I think you can assume that support in its current state won't go away any time soon. It's part of the GCC code base and the Clang toolchain (Apple's next compiler toolchain) fully supports Objective-C++. On the other hand, there isn't any official guarantee that Apple will continue to develop the integration—fixing some of the warts, for example.

For current projects, I would say that if using Objective-C++ provides benefit, it is safe to rely on the existing support and you should use it.

like image 199
Barry Wark Avatar answered Sep 27 '22 17:09

Barry Wark