strange situation with frameworks
strange situation with frameworks
- Subject: strange situation with frameworks
- From: Ayyapu Reddy <email@hidden>
- Date: Tue, 5 Sep 2006 20:34:13 +0530
Hi,
I am into a strange situation where i couldn't figure out a way.
Here is the situation:
I have a Cocoa Application which has a framework added, let's say
MyCode.framework with a class (TestClass) with a method
- (void)display;
Now in my application code i am trying to load one more framework
(MyUtility.framework) dynamically which has got same class(TestClass)
with same method which is trying to do some similar kind of job.
I am loading this framework dynamically at runtime and calling a
function(testFun()) which creates an object of TestClass and calls
display method on it. This call is calling the method of class
present in the MyCode.framework instead of MyUtility.framework's
class method.
I really couldn't understand what's happening here.
Is the class from the MyUtility.framework couldn't loaded because of
the same class is present in MyCode.framework and which is already
loaded. If yes, how can i make my function(testFun()) present in
MyUtility.framework to create the class object present in itself.
Thanks in advance for any help on this.
Regards,
Ayyapu Reddy
This is how i am loading MyUtility.framework:
CFStringRef url = CFSTR("/Users/ayyapureddy/MyUtility.framework");
CFURLRef urlRef = CFURLCreateWithFileSystemPath
(NULL,url,kCFURLPOSIXPathStyle,true);
CFBundleRef bundleRef = CFBundleCreate(NULL,urlRef);
typedef void (*FrameWorkFun)();
FrameWorkFun testFun;
if(bundleRef)
testFun = (FrameWorkFun)CFBundleGetFunctionPointerForName
(bundleRef, CFSTR("testFun"));
CFRelease(bundleRef);
testFun();
Here is the implementation of testFun() in MyUtility.framework
void testFun()
{
TestClass *testObj = [[TestClass alloc] init];
[testObj display];
[testObj release];
}
______________________________________________________________
DISCLAIMER:
This electronic message, and any attachments to this electronic message are
intended for the exclusive use of the addressee(s)named herein and may contain
legally privileged and confidential information. It is the property of Celstream
Technologies Pvt. Ltd. If you are not the intended recipient, you are hereby
strictly notified not to copy, forward, distribute or use this message or any
attachments thereto. If you have received this message in error, please delete
it and all copies thereof from your system and notify the sender at Celstream
Technologies or email@hidden immediately
_______________________________________________________________
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden