| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
so i suppose a bigger question is: is it safe/allowed/"not discouraged" to call HAL routines, such as AudioHardwareAddPropertyListener(), at +load time when the program is first starting? the documentation for +load (NSObject) mentions that no guarantees are made about the order of +load being sent in the class hierarchy (vs +initialize). also, this +load is being sent to a (usually) dynamically loaded framework in the app's bundle, but against which the main application object was linked. the docs for +load don't really mention the impact of doing non-objective-C things, though.
i put the AudioHardwareAddPropertyListener() in +load because the semantic i wanted to provide was "if you link in MTCoreAudio, then you'll magically get NSNotifications for audio hardware events like the device list changing and stuff". if hooking up at +load isn't safe, it won't be the end of the world to move this to +[MTCoreAudioDevice initialize], since almost every app will start out with an
[MTCoreAudioDevice attachNotificationsToThisThread];
or getting the device list or a default device or something, which will cause +initialize to happen in that class.
Stéphane's problem is the first issue with my having done this that i've heard of, though. hopefully it wasn't a ticking timebomb waiting to ruin someone's day.
| References: | |
| >Re: Initializing static C++ class variable in a HAL plugin (From: Stéphane Letz <email@hidden>) | |
| >Re: Initializing static C++ class variable in a HAL plugin (From: Jeff Moore <email@hidden>) | |
| >Re: Initializing static C++ class variable in a HAL plugin (From: Michael Thornburgh <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.