I would like to create a portable library for iPhone, that also could be used for other platforms.
My question is the fallowing:
Does anyone knows what is the best to be used on the iPhone: Objective-C or Objective-C++? Does it works with C++ the same way as Objective-C with C or not?
Reasons: Objective-C is a superset of C, but Objective-C++ is not
a superset of C++.
Thanks in advance!
UPDATE: What about memory usage, speed in the same implementation of an use case?
UPDATE1: If anyone can provide any more information, he'll be welcome.
Most of the core iOS and MacOs software is still written in Objective-C, though Apple is pushing for new updates to be written in Swift.
It's because Objective C has been the de facto language for Mac OS X development before it was Mac OS X. When Jobs left Apple to set up NeXT, the language Objective C was developed as a specific language that wasn't C++ and avoided many of its pitfalls.
iOS applications are typically developed in a programming language called Objective-C and supported by a support library called Cocoa Touch.
According to Apple, Swift is approximately 2.6 times faster than Objective C. The speed calculated generally relates to the speed of coding. Swift's syntax is much more simple and direct than Objective-C. This enables developers to focus on the core part of the code rather than the rules on which the codes are based.
If you're writing a portable library, and don't need specific language features for it, why not write it in straight C? It can be easily called from C++, C, Objective-C, and many, many other languages.
If you require specific language features that aren't available in C, you should tell us what they are so you can get better advice =)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With