• 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: Copying id
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Copying id


  • Subject: Re: Copying id
  • From: Ken Thomases <email@hidden>
  • Date: Sun, 10 Aug 2008 02:34:23 -0500

On Aug 10, 2008, at 2:05 AM, Mike wrote:

How does one go about copying an object specified by id when one doesn't know the object type and the object does not implement NSCopying protocol?

The short answer is: you don't. If an object's class doesn't implement NSCopying, then there are no known semantics for what making a copy of it should mean. Just to pick a random example, what might it mean to copy an NSTask object? Or an NSThread? I could keep going, of course.


However, I'm having a hard time imagining under what circumstances you would want to do this. If you don't know what kind of object you have, and the object itself doesn't know how to make a copy, why do you want (or think you need) to make a copy?

Cheers,
Ken
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Copying id
      • From: Mike <email@hidden>
References: 
 >Copying id (From: Mike <email@hidden>)

  • Prev by Date: Copying id
  • Next by Date: Re: Custom URL Handling
  • Previous by thread: Copying id
  • Next by thread: Re: Copying id
  • Index(es):
    • Date
    • Thread