Hallo, ich habe ein array von welchem ich ein deep copy machen möchte, als quelle für meine idee habe ich diese seite:techotopia.com/index.php/Copying_Objects_in_Objective-C. Ich versuche es wie unten beschrieben(unten auf der website), ich bekomme aber folgenden fehler:
Alles anzeigen
Hier die wichtigen code teile:
Alles anzeigen
Alles anzeigen
Alles anzeigen
danke für eure hilfe!!
Quellcode
- *** -[coints encodeWithCoder:]: unrecognized selector sent to instance 0x2403d0
- 2010-06-01 17:11:03.142 MatisCode[1132:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[coints encodeWithCoder:]: unrecognized selector sent to instance 0x2403d0'
- 2010-06-01 17:11:03.159 MatisCode[1132:207] Stack: (
- 843631901,
- 849079828,
- 843635709,
- 843131673,
- 843094080,
- 814669327,
- 814672061,
- 814671717,
- 814669327,
- 814672061,
- 814671717,
- 814669327,
- 814668589,
- 814667249,
- 18368,
- 843389071,
- 639848,
- 642072,
- 685468,
- 857786624,
- 857784212,
- 857765776,
- 857763988,
- 875472868,
- 843380011,
- 843377695,
- 875467208,
- 857431088,
- 857424432,
- 11988,
- 11840
- )
- terminate called after throwing an instance of 'NSException'
- Program received signal: “SIGABRT”.
Hier die wichtigen code teile:
Quellcode
Quellcode
Quellcode
- NSMutableArray* sourceArray;
- NSData* buffer=[NSKeyedArchiver archivedDataWithRootObject:_cointArray];
- sourceArray=[NSKeyedUnarchiver unarchiveObjectWithData:buffer];
- int diffStopStartX=(Stoplocation.x-Startlocation.x);
- int diffStopStartY=(Stoplocation.y-Startlocation.y);
- for(int i=0;i<16;i++)
- {
- [self removeChild:[_cointArray objectAtIndex:i] cleanup:YES];
- }
- [_cointArray removeObjectsInArray:_cointArray];
danke für eure hilfe!!