maccatalan
Registered
Hello.
I'm trying to make a new little game of Awale (an african strategy game).
My problem ? I'm trying to get an object from a NSMutableArray removing it from the array. When I execute a piece of code the application does nothing and the console of PB outputs : "2002-07-01 23:48:39.185 Cocowale[357] *** -[awale copyWithZone:]: selector not recognized". Here you've got the code, where awales is my array and currentAwale is an awale object (you've got the header after the bugged(?!) code) :
//-------------------------------------- this is where it fails
[currentAwale autorelease];
currentAwale = [[awales objectAtIndex:[awales count]-1] copy];
[awales removeObjectAtIndex:[awales count]-1];
//---------------------------------------
The awale class (the type of currentAwale) header :
//---------------------------------------
#import <Foundation/Foundation.h>
@interface awale : NSObject {
int trous[12];
int quiJoue;
int gains[2];
}
- (BOOL) playint)w;
- (int) trouint)w;
- (int) quiJoue;
- (int) gainsint) qui;
@end
//---------------------------------------
I suppose the problem comes from the int type that is not similar to a NSObject children. So I should cerate some "copy" method. This is what I think. But here my two question : am I right ? and How to do ?
thank you very much
Pierre.
I'm trying to make a new little game of Awale (an african strategy game).
My problem ? I'm trying to get an object from a NSMutableArray removing it from the array. When I execute a piece of code the application does nothing and the console of PB outputs : "2002-07-01 23:48:39.185 Cocowale[357] *** -[awale copyWithZone:]: selector not recognized". Here you've got the code, where awales is my array and currentAwale is an awale object (you've got the header after the bugged(?!) code) :
//-------------------------------------- this is where it fails
[currentAwale autorelease];
currentAwale = [[awales objectAtIndex:[awales count]-1] copy];
[awales removeObjectAtIndex:[awales count]-1];
//---------------------------------------
The awale class (the type of currentAwale) header :
//---------------------------------------
#import <Foundation/Foundation.h>
@interface awale : NSObject {
int trous[12];
int quiJoue;
int gains[2];
}
- (BOOL) playint)w;
- (int) trouint)w;
- (int) quiJoue;
- (int) gainsint) qui;
@end
//---------------------------------------
I suppose the problem comes from the int type that is not similar to a NSObject children. So I should cerate some "copy" method. This is what I think. But here my two question : am I right ? and How to do ?
thank you very much
Pierre.