Possiedo un NSMutableArray che sto tentando di memorizzare e accedere ad alcune strutture. Come faccio a fare questo? 'addObject' mi dà un errore che dice "Tipo incompatibile per argomento 1 di addObject". Ecco un esempio ('in' è un NSFileHandle, 'allineamento' è il NSMutableArray):Strutture di cacao e 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);
}
voti in su stanno dicendo tutto :) – TheTiger
Non so chi sei, ma ti troverò e ti farò una birra! – CjCoax