• 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
strange situation with frameworks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: strange situation with frameworks
      • From: "Michael Ash" <email@hidden>
  • Prev by Date: Re: Cocoa equivalent to fputc()?
  • Next by Date: Re: Re: PyObjC
  • Previous by thread: RE: Stream programming: premature 'end encountered' event [sorry for repost]
  • Next by thread: Re: strange situation with frameworks
  • Index(es):
    • Date
    • Thread