• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Bundle loading question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bundle loading question


  • Subject: Bundle loading question
  • From: Darrin Cardani <email@hidden>
  • Date: Mon, 28 Jun 2004 10:59:13 -0500

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.


  • Follow-Ups:
    • Re: Bundle loading question
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Re: Resizing NSButton doesn't clear previous size
  • Next by Date: Re: Fonts
  • Previous by thread: Bindings NSTableView Refresh
  • Next by thread: Re: Bundle loading question
  • Index(es):
    • Date
    • Thread