Mac Problems with Objective-C++?

frank100

macrumors newbie
Original poster
May 9, 2012
15
0
Every so often I have my rants with Objective-C because I terribly miss having namespaces and templates, something that seems already solved in Objective-C++

Although it seems an easy transition, I am not sure about the problems of switching to Objective-C++

So far I have read about problems with ARC, interface builder, refactoring and instruments tools... but I am not sure if all that is "still true"

How safe is it switching to Objective-C++? Which problems should I expect? In which cases should I avoid it? Should I avoid Objective-C++ in my views and/or setting that as the main class of my XIBs?
 

gnasher729

macrumors P6
Nov 25, 2005
16,594
3,218
Every so often I have my rants with Objective-C because I terribly miss having namespaces and templates, something that seems already solved in Objective-C++?
Do yourself a favor and enjoy life without namespaces and templates. Objective-C++ is for connecting Objective-C with C++ code and nothing else. Objective-C classes don't use namespaces. And they don't use templates.
 

Mac_Max

macrumors 6502
Mar 8, 2004
404
0
I miss namespaces as well. I hope that at some point they're added as an optional extension to Obj C. In the meanwhile you can use smurf naming to avoid problems... I.e.

smurfPartsTableViewController
smurfTextHelpingClass

If you aren't familiar with the smurfs.... Basically prefix every class name.

If you're working with something that can be done dramatically faster with templates then do just that part with a template method or a template function (remember that not all things need to be done with objects).
 

iMacFarlane

macrumors 65816
Apr 5, 2012
1,123
23
Adrift in a sea of possibilities
I miss namespaces as well. I hope that at some point they're added as an optional extension to Obj C. In the meanwhile you can use smurf naming to avoid problems... I.e.

smurfPartsTableViewController
smurfTextHelpingClass

If you aren't familiar with the smurfs.... Basically prefix every class name.

If you're working with something that can be done dramatically faster with templates then do just that part with a template method or a template function (remember that not all things need to be done with objects).
What a smurftastic solution!