Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ for Objective-C programmer [closed]

I know there are a lot of "Objective-C for the C++ programmer" information out there and it could be used the other way around. I'm just curious if there is anyone who has knowledge about a "native" "C++ for the Objective-C programmer" tutorial/book?

I'm actually looking to work in C++ in parts of a upcoming iOS project. Basically I need to do a lot of wrappers around C++ code.

(I do know that they can co-exist and that Obj-C is a subset of C, just like C++, however different reasons I would like to gain more knowledge into C++. Coming from a Obj-C background I just ask for some guidance on the matter.)

like image 993
sebrock Avatar asked Nov 05 '11 14:11

sebrock


People also ask

Is Objective-C close to C?

Syntactically, Objective-C is an extension of C. So, some portion of Objective-C is exactly the same as C. Your experience of C would help learning such aspect of Objective-C. But the core part of Objective-C programming is made of Object Oriented class system, which you cannot find in C.

Is Objective-C still used in 2022?

There are a lot of indicators telling us there's still a ton of legacy Objective-C code, both from Apple and from other developers, that's still in use.

Is Objective-C going away?

If Swift succeeds, Objective-C will go away. 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 Objective-C only for Apple?

Objective-C is the primary programming language you use when writing software for OS X and iOS.


2 Answers

I don't know of a book for learning C++ for the Objective-C programmer. The fact that the Objective-C foundation libraries offer a lot out of the box (not to mention all the other frameworks which are part of the iOS and Mac SDKs, which is the main use-area for Objective-C) which is not covered by the C++ standard libraries might be a reason. The new C++11 standard and the boost C++ libraries go some way to bridging the gap.

There are quite a few articles which describe the main difference including this one.

The understanding of OOP you have aquired in Objective C as well as it's C subset (in your question you say "Obj-C is a subset of C", it's the opposite), will give you a big head start in learning C++, but it seems you have no alternative than to use C++ books and learn directly from them.

EDIT:

Adding the link to the SO post on good C++ books, suggested by @Bart in the comments.

like image 101
jbat100 Avatar answered Oct 19 '22 23:10

jbat100


Take a look at Pierre Chatelier's comparison of C++ and Objective-C.

This document is designed to act as a bridge between C++ and Objective-C.

http://pierre.chachatelier.fr/programmation/fichiers/cpp-objc-en.pdf

like image 40
Alex Nolasco Avatar answered Oct 20 '22 00:10

Alex Nolasco