Patching implementation in +load. Was: …Mapping Model : Spurious Warning
Patching implementation in +load. Was: …Mapping Model : Spurious Warning
- Subject: Patching implementation in +load. Was: …Mapping Model : Spurious Warning
- From: Jerry Krinock <email@hidden>
- Date: Tue, 7 Sep 2010 15:41:17 -0700
The workaround given in the note [1] works.
But it recommends that you patch NSMigrationManager "in a method that is guaranteed to be invoked before migration could be attempted—for example, if you have an application delegate, this could be in its init method"
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?
Jerry
[1] http://developer.apple.com/mac/library/releasenotes/Cocoa/MigrationCrashBuild106Run105/index.html
[2] +[NSObject load]
Invoked whenever a class or category is added to the Objective-C runtime; implement this method to perform class-specific behavior upon loading.
+ (void)load
Discussion
The load message is sent to classes and categories that are both dynamically loaded and statically linked, but only if the newly loaded class or category implements a method that can respond.
_______________________________________________
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