Re: Can't use +initialize, now what?
Re: Can't use +initialize, now what?
- Subject: Re: Can't use +initialize, now what?
- From: Jens Alfke <email@hidden>
- Date: Wed, 29 Mar 2017 13:17:50 -0700
> On Mar 29, 2017, at 10:52 AM, Quincey Morris <email@hidden> wrote:
>
> If willFinishLaunching is not early enough, then you can put code in your “main” function, but I don’t know how feasible that is in Swift.
Another trick to run stuff earlier at launch is to add an -awakeFromNib method to your app delegate, or any other object in your main nib. This can be dangerous, though, because you can’t count on any other object in the nib already being awoken, since the -awakeFromNib methods are called in random order. (I once had a very hard to debug intermittent crash due to an ordering dependency between two -awakeFromNib methods.)
—Jens
_______________________________________________
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