I am trying create an NSArray which holds the datatype of serialized files i will be loading from disk.
It can say double, int, or some custom type, and then I will need to load those files and cast them to double/int/custom type.
Is there a way I can store types in NSArray but not store strings?
so far, it seems that there is no way but to use stringified types as I show in this example.
any ideas?
C types are not something you can store. There's no C code like:
Objective-C has type awareness, but would require you to map all of your original data to an Objective-C class. E.g.
You can't in general store types without values; this is because there's really no value whatsoever in doing so. Type and value are inherently connected — severing them while keeping type explicit and retaining a one-to-one mapping suggests a severe design deficiency.