4 ms·
For one, ObjC can't treat objects as values or initialize them on the stack. Also, the everything-is-an-object paradigm is terrible for arrays of values, since
by archagon 8y ago
For one, ObjC can't treat objects as values or initialize them on the stack. Also, the everything-is-an-object paradigm is terrible for arrays of values, since every NSNumber or NSValue has to be individually malloced and released. (Though maybe not the case anymore? It was certainly a chokepoint several years ago.)
Both of these factors have forced me into using lower-level Objective-C++ code on numerous occasions.
- mercutio2 8y agoNSNumbers are generally tagged pointers, unless you’ve got a really large number.
- deleted 8y ago[deleted]
- archagon 8y agoThis didn't help me in my app, unfortunately, because I needed to encode CGPoints as NSValues. I suppose I could have resorted to ordinary, interleaved CGFloats, but it was way easier and more productive to just use C++ vectors. I knew exactly what I was getting with those, and I didn't have to do the boxing/unboxing dance.