I am trying to use the Cocoa framework inside a plugin (NSBundle) as a loosely coupled structure, so I can use it in several plugins. I have a source for the framework, and I have successfully used the framework in another plugin, although not as a loosely coupled structure. In this case, it works well.
This works, but when I try to use the extern * const property when setting up aspects of the framework from my code, the application crashes with the following error:
Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000
An example of a constant declared in the framework:
Class.h extern NSString * const AConstant;
And implementation:
Class.m NSString *const AConstant = @"someString";
The code in my application causing the error:
NSLog(@"%@", AConstant);
The frame is loading - if I'm not trying to use constants, it works as expected. I can also configure it using the constant value manually, i.e.
[framework setConfig:@"someString"]
Instead of what I prefer to use:
[framework setConfig:AConstant]
As stated above, I can change the structure if necessary.
Does anyone have any advice on what I can do to make this infrastructure work as weak fragmentation?
Michael robinson
source share