3 ms·
There's nothing technically wrong with it, and there are definitely situations that may require it. But IMO, in a huge ViewController, you ideally want to avoid
by autoreleasepool 11y ago
There's nothing technically wrong with it, and there are definitely situations that may require it. But IMO, in a huge ViewController, you ideally want to avoid using Objective-C++ code directly. It's better to use wrappers. This is mostly because Objective-C++ has many surprises and is poorly documented. It can be a PITA to debug.
It's a better practice, IMO, to isolate your Objective-C++ code into individual .mm files if you can. Try to keep the majority of your code in .m, or .cpp files and use wrappers. The idea is to try and work with a pure C++ or Objective-C compiler for each compilation unit, wherever possible. The saner compiler will save you a few headaches.