Hm, intenta mirar el NSValue
en https://developer.apple.com/documentation/foundation/nsvalue
Se puede utilizar como
struct aStruct
{
int a;
int b;
};
typedef struct aStruct aStruct;
Entonces especie de "envolver" a un objeto NSValue
como:
aStruct struct; struct.a = 0; struct.b = 0;
NSValue *anObj = [NSValue value:&struct withObjCType:@encode(aStruct)];
NSArray *array = @[anObj];
Para extraer la estructura del NSValue
use:
NSValue *anObj = [array firstObject];
aStruct struct;
[anObj getValue:&struct];
supongo que más adelante, puede tener una categoría de NSValue para hacer que una mejor = D
posible duplicado de [¿Cuál es la mejor manera de poner un c-struct en un NSArray?] (Http://stackoverflow.com/questions/4516991/whats-the-best-way-to-put-ac-struct -in-an-nsarray) –