Tengo un NSMutableArray que intento almacenar y acceder a algunas estructuras. ¿Cómo hago esto? 'addObject' me da un error que dice "Tipo incompatible para el argumento 1 de addObject". Aquí hay un ejemplo ('en' es un NSFileHandle, 'array' es el NSMutableArray):Cocoa structs y NSMutableArray
//Write points
for(int i=0; i<5; i++) {
struct Point p;
buff = [in readDataOfLength:1];
[buff getBytes:&(p.x) length:sizeof(p.x)];
[array addObject:p];
}
//Read points
for(int i=0; i<5; i++) {
struct Point p = [array objectAtIndex:i];
NSLog(@"%i", p.x);
}
up votos dicen todo :) – TheTiger
¡No sé quién es usted, pero lo encontraré y le daré una cerveza! – CjCoax