• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSInvalidArgumentException : can't send message to abstract object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSInvalidArgumentException : can't send message to abstract object


  • Subject: Re: NSInvalidArgumentException : can't send message to abstract object
  • From: Aram Greenman <email@hidden>
  • Date: Fri, 26 Apr 2002 14:13:07 -0700

On 4/26/02 9:09 AM, "Erik M. Buck" <email@hidden> wrote:

> NSData is a class cluster. That makes it more difficult to subclass. Apple
> provides excellent documentation on the subject.
>
> You are awar that you do not need to create your own GUIDs aren't you.
>
> See CFUUID: used to produce universally unique 16-byte identifiers
> See [NSProcessInfo globallyUniqueString]
>

I was actually _not_ aware of that. I am really only using a quasi-GUID,
anyway (certain bytes are tagged), but this is useful to know.

Thanks to all who responded!

Aram

>
>
> ----- Original Message -----
> From: "Aram Greenman" <email@hidden>
> To: "cocoa-dev" <email@hidden>
> Sent: Friday, April 26, 2002 1:08 AM
> Subject: NSInvalidArgumentException : can't send message to abstract object
>
>
>> 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?
>> Thanks,
>>
>> Aram
>> _______________________________________________
>> 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.
_______________________________________________
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.

References: 
 >Re: NSInvalidArgumentException : can't send message to abstract object (From: "Erik M. Buck" <email@hidden>)

  • Prev by Date: Re: NSDocument: how to save document as a simple text file
  • Next by Date: Re: Subclassing NSDictionary...
  • Previous by thread: Re: Sometimes a method gets called, sometimes it doesn't.
  • Next by thread: CFUUID vs. -[NSProcessInfo globallyUniqueString] (was Re: NSInvalidArgumentException : can't send message to abstract object)
  • Index(es):
    • Date
    • Thread