Re: NSInvalidArgumentException : can't send message to abstract object
Re: NSInvalidArgumentException : can't send message to abstract object
- Subject: Re: NSInvalidArgumentException : can't send message to abstract object
- From: Thomas Lachand-Robert <email@hidden>
- Date: Fri, 26 Apr 2002 08:48:49 +0200
Le vendredi 26 avril 2002, ` 08:08 , Aram Greenman a icrit :
I know this has to SO DUMB, but I have racked my brain and the docs --
here's the offending code:
@interface GUID : NSData {
}
+ (GUID *)guid;
@end
@implementation GUID
+ (GUID *)guid {
unsigned char buffer[16];
// guid is generated and stored in buffer
return [self dataWithBytes:buffer length:16];
}
@end
when I call [GUID guid], I get this exception:
*** Uncaught exception: <NSInvalidArgumentException> *** initialization
method -initWithBytes:length:copy:freeWhenDone:bytesAreVM: cannot be sent
to
an abstract object of class GUID: Create a concrete instance!
Doesn't +dataWithBytes:length: create a concrete instance with +alloc ?
(Of
course the answer must be "no", otherwise this would work) What's up?
I believe you have accidentally discovered class clusters ;-)
Search these words in the archives to understand the issue.
Thomas Lachand-Robert
********************** email@hidden
<< Et le chemin est long du projet ` la chose. >> Molihre, Tartuffe.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.