Answer the question
In order to leave comments, you need to log in
class or structure?
Help with advice to a beginner: what type of object is best to use to organize an NSMutableDictionary?
As I understand it, they usually use objects of some class, or you can wrap the structure in NSValue (withObjCType).
What is the difference?
Answer the question
In order to leave comments, you need to log in
If you have reference fields in the structure - like const char * - then withObjCType will not save you.
Use classes (NSObject descendants) wherever you don't have performance issues.
withObjCType will not wrap the structure. Yes, and it makes sense to wrap it in NSValue, make a class right away.
the structure is simple - a few floats. but the array is big enough and it's all for ios. In such a case would using a class be potentially slower than a struct?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question