C vs C++ (Objective-C vs Objective-C++) for iPhone

后端 未结 8 1720
余生分开走
余生分开走 2021-02-01 22:58

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 be

相关标签:
8条回答
  • 2021-02-01 23:51

    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 =)

    0 讨论(0)
  • 2021-02-01 23:53

    The truth is you can use C or C++ in Xcode. The reason to use Objective C for Cocoa and Cocoa Touch (iphone) is because of it's ease of use and how it handles many of the memory issues you would come across on it's own. Objective C and Xcode work like a dream. I would also recommend checking out http://www.kevincallahan.org/software/accessorizer.html Accessorizer is amazing and cuts development time into nothing.

    Having said that I see no problem in writing functions/methods in C or C++ and using them within a part of your XCode project. Just do not expect to use Objective C to play as nicely on other platforms. Apple and Windows development IDE's are different and Microsoft has a nice habit for not making things as compatible with other environments (not just Apple.)

    I am glad to hear someone out their trying to reuse their code for other projects : ) Too many people forget to create their own libraries these days and I haven't the slightest idea why.

    I hope this helps. Cheers, Matthew

    0 讨论(0)
提交回复
热议问题