Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bundle loading question



I have an iMovie plugin that contains a .nib file for a window that it displays to allow the user to configure some settings. I get the bundle during a time when the bundle is already loaded and I retain it by doing the following:

gPluginBundle = [[NSBundle bundleWithIdenitifier:@"mybundleident"] retain];

That works, and gPluginBundle is not nil. Later, I attempt to load the nib file by doing the following:

if ([gPluginBundle loadNibFile:@"nibfilename" externalNameTable:nameTable withZone:nil]) {
// Do stuff here
}

This works 9 times out of 10. About every 10th time or so, it crashes. Looking at the stack trace, I see that -[NSBundle loadNibFile:externalNameTable:withZone:] is calling methods which eventually attempt to load one of the custom views in my window. -[NSCustomView nibInstantiate:] is sending some Objective C method, and eventually it crashes further down in the stack. Looking at the disassembly, I see that the crash is on a call to _setThisThreadIsInitializingClass.

Since the crash appears to be in _setThisThreadIsInitializingClass, and since it only happens sporadically, I'm thinking it may be a threading issue. iMovie is multithreaded and plugins do get called by other threads while they're already executing. Are there threading issues I need to be aware of when loading nibs? Is there any documentation that would help me with this? (My searches on the ADC web site didn't turn up anything obvious.)

Thanks,
Darrin
--
Darrin Cardani - email@hidden
President, Buena Software, Inc.
<http://www.buena.com/>
Video, Image and Audio Processing Development
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.




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.