• 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: [Q] CopyWithZone:error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Q] CopyWithZone:error


  • Subject: Re: [Q] CopyWithZone:error
  • From: Bill Cheeseman <email@hidden>
  • Date: Fri, 30 Aug 2002 16:36:51 -0400

on 02-08-30 3:06 PM, Mark de Jong at email@hidden wrote:

> I changed something in my code, not sure what <sheepish grin>, but now
> I'm getting the following runtime errors:
>
> *** -[MyObject copyWithZone:]: selector not recognized
> An uncaught exception was raised

<snip>

> What I need are some clues as to how to debug this. When I step through
> it, the stack trace includes:
>
> 0 -[NSException raise]
> 1 +[NSException raise:format:]
> 2 -[NSObject(NSForwardInvocation) forward::]
> 3 _objc_msgForward
> 4 -[NSCell _setContents]
> 5 -[NSCell setObjectValue:]

I could use some clues about how to debug this sort of problem, too.

I see that, directly or indirectly, your exception comes while sending the
[NSCell setObjectValue:] method. The object you are trying to put into the
cell (or into the table or outline) must conform to the NSCopying protocol.
If MyObject is a custom object that inherits from NSObject (which does not
conform to the NSCopying protocol), you must add the necessary method,
copyWithZone:, to MyObject to make it conform to the NSCopying protocol.

This is demonstrated by this excerpt from the NSCell class documentation:

- (void)setObjectValue:(id <NSCopying>)object


--

Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com

The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes
Croquet Club of Vermont - http://members.valley.net/croquetvermont
_______________________________________________
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: 
 >[Q] CopyWithZone:error (From: Mark de Jong <email@hidden>)

  • Prev by Date: Borderless floating windows
  • Next by Date: Re: Break on -[NSException raise] as a permanent setting?
  • Previous by thread: [Q] CopyWithZone:error
  • Next by thread: Re: [Q] CopyWithZone:error
  • Index(es):
    • Date
    • Thread