On Jun 7, 2006, at 8:05 PM, Brian O'Brien wrote:
> On 7-Jun-06, at 8:46 PM, Bob Ippolito wrote:
>> On Jun 7, 2006, at 7:36 PM, Brian O'Brien wrote:
>>> Hi, I've been having loading a bundle.
>>> The bundle use to load but then the underlying ObjectiveC and C++
>>> have been modified.
>>> I can't say that I think its the mods that are causing the
>>> Traceback (most recent call last):
>>> File "testit.py", line 7, in ?
>>> objc.loadBundle("MRCDicom", globals(), bundle_path=FrameworkDir
>>> ImportError: Bundle could not be loaded
>>> Seems a little sparse on an explanation as to 'why' the bundle could
>>> not be loaded.
>>> Any suggestions as to what I can do to narrow down this problem?
>> It doesn't know why, NSBundle doesn't have any error reporting. It
>> just returns NO from -[NSBundle load]. Maybe you should make sure
>> that the path is absolute and exists? Other than that, make sure all
>> of its dependencies are around and exist I guess... Poke at the
>> bundle with otool -L.
>> It might also be that someone compiled the framework with ZeroLink,
>> which breaks everything for everyone but the person who compiled
>>> The first parameter in the loadBundle call is the framework name?
>>> Can you explain this parameter to me? Does this text reflect
>>> something I name in xCode?
>> The first parameter to loadBundle is only used to set __module__
>> attribute on new classes (that's why it's called module_name).
> Ok I just used XCode to create a new framework with absolutely
> nothing in it.
> I checked zerolink and it is off.
>>>> import objc
>>>> objc.loadBundle("testit", globals(), bundle_path='/Volumes/Data/
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> ImportError: Bundle could not be loaded
> Don't know what you want me to do with otool....
otool is used on Mach-O files to see what they depend on.
There's definitely nothing wrong with loadBundle, it works fine here..
>>> import objc
>>> objc.loadBundle('test', globals(), bundle_path='/System/Library/
NSBundle </System/Library/Frameworks/CoreData.framework> (loaded)
>>> import objc
>>> objc.loadBundle('test', globals(), bundle_path='/Library/
NSBundle </Library/Frameworks/SDL.framework> (loaded)