Cannot inherit from NSMutableData
Hi,
I have created a new class, from NSMutableData.
@interface MsgSetGame : NSMutableData {
}
@end
There is no implementation, I just want to used methods from the mother class.
Curiously, I cannot send methods to an object of this class:
const char Buffer[5] = {1, 2, 3, 4, 5};
NSLog(@"Avant création MsgSetGame");
MsgSetGame *myGame = [MsgSetGame alloc];
[myGame initWithLength:40];
NSLog(@"Avant append");
[myGame appendBytes:Buffer length:5];
NSLog(@"Avant release");
[myGame release];
The app crashes with the following message on the console:
2010-01-10 18:51:49.169 BMEngine[21024:207] updateStateMachine: STATE_BIDDING_GAME_UNCOMPLETED
2010-01-10 18:51:49.170 BMEngine[21024:207] Avant création MsgSetGame
2010-01-10 18:51:49.170 BMEngine[21024:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -initWithCapacity: only defined for abstract class. Define -[MsgSetGame initWithCapacity:]!'
Curiously, NSMutableData is not abstract, thus I do not have to implement the inherited methods. Might this be due to the fact that NSMutableData is a custer class?
Regards,
Franz
|