• 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: [moderator] Re: swizzling a class to a subclass inorder to add ivars (& methods) to a class
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [moderator] Re: swizzling a class to a subclass inorder to add ivars (& methods) to a class


  • Subject: RE: [moderator] Re: swizzling a class to a subclass inorder to add ivars (& methods) to a class
  • From: Scott Morrison <email@hidden>
  • Date: Mon, 30 Oct 2006 16:22:13 -0500

Apart from all the WWDC NDA stuff -- (which is pretty hard to miss considering they have that on every opening slide of each presentation, and was in reminders all over Moscone) Lets get back to the original question.....


Is it OK to swizzle the alloc method to return an allocated subclass rather than the superclass that was whose allocation was requested. What are problems associated with this? -- Yes -- there may be hidden implementation stuff that you are mucking about it. but if you know the classes involved -- is there a problem?




From what I seen of some things (from google searches), this is done in a variety of situations (eg [NSDictionary alloc] to return different private implementations depending on a variety of situations)

Scott

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: RE: [moderator] Re: swizzling a class to a subclass inorder to add ivars (& methods) to a class
      • From: "Clark Cox" <email@hidden>
    • Re: [moderator] Re: swizzling a class to a subclass inorder to add ivars (& methods) to a class
      • From: John Stiles <email@hidden>
  • Prev by Date: column of buttons in NSTableView
  • Next by Date: Re: [moderator] Re: swizzling a class to a subclass inorder to add ivars (& methods) to a class
  • Previous by thread: Re: column of buttons in NSTableView
  • Next by thread: Re: [moderator] Re: swizzling a class to a subclass inorder to add ivars (& methods) to a class
  • Index(es):
    • Date
    • Thread