Re: Patching implementation in +load. Was: …Mapping Model : Spurious Warning
Re: Patching implementation in +load. Was: …Mapping Model : Spurious Warning
- Subject: Re: Patching implementation in +load. Was: …Mapping Model : Spurious Warning
- From: Kyle Sluder <email@hidden>
- Date: Tue, 7 Sep 2010 15:55:57 -0700
On Tue, Sep 7, 2010 at 3:41 PM, Jerry Krinock <email@hidden> wrote:
> Messy. I added a +load method to the NSMigrationManger category that I added, and invoked the patch in there. Seems to work fine. Is +load [2] not the recommended place to invoke patches?
+load is kind of risky. See Bill Bumgarner's discussion of
initialization methods here:
http://www.friday.com/bbum/2009/09/06/iniailize-can-be-executed-multiple-times-load-not-so-much/
Since all you're doing is adding methods, +load might be an okay time
to do things, except if the method you're replacing comes from a
category. You might want to defer to +initialize instead.
--Kyle Sluder
_______________________________________________
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