Kakao Strukturen und NSMutableArray

Ich habe ein NSMutableArray, dass ich versuche, zu speichern und den Zugriff auf bestimmte Strukturen. Wie mache ich das? 'addObject' gibt mir eine Fehlermeldung "Inkompatibler Typ für argument 1 von addObject". Hier ist ein Beispiel ('in', ist ein NSFileHandle, 'array' ist der 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);
}
InformationsquelleAutor Circle | 2010-06-01
Schreibe einen Kommentar