Re: [Pyobjc-dev] "out" parameters and return values
Brought to you by:
ronaldoussoren
|
From: Orestis M. <or...@or...> - 2009-02-17 20:37:00
|
Hello, I'm afraid that I don't know the answer, but it seems to me that what you describe should be a valid approach - I mean that it seems like the most reasonable syntax for this job. I assume that you've tried it and it doesn't work. Could you share what the output is? Orestis -- or...@or... http://orestis.gr/ On 17 Feb 2009, at 19:51, Mani Ghasemlou wrote: > Just wanted to raise this question again, as I still haven't found a > solution. > > I've posted the same question on Cocoa-dev, also with no response: > http://www.cocoabuilder.com/archive/message/cocoa/2009/2/2/229316 > > Would greatly appreciate any insights! > > Kind regards, > Mani > > On Mon, Feb 2, 2009 at 9:34 AM, Mani Ghasemlou <ma...@tu...> > wrote: >> Hi all, >> >> From what I understand of the PyObjc documentation, "out" pointer >> variables (such as "NSError **outError") are actually appended to the >> list of return values for a bridge function. >> >> For example: >> >> int returnIntWithError: NSError **outError >> >> from Python would be invoked as: >> >> returned_int, returned_error = returnIntWithError_(None) >> >> I hope that my understanding of the above is correct. >> >> Now, my real question is to extend the above concept to the Python >> side, when we want to implement an informal protocol. Let's say the >> protocol says that I have to implement the returnIntWithError: >> function as described above. How do I implement this function? Is the >> code below enough? >> >> def returnIntWithError_(self, outError): >> myError = NSError.errorWithDomain_code_userInfo_('myDomain', '1', >> objc.nil) >> myReturnVal = 1 >> return myReturnVal, myError >> >> Note that I am completely ignoring the "outError" parameter. Does >> this >> look kosher? >> >> Thanks in advance for any help! >> >> Cheers, >> Mani >> > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San > Francisco, CA > -OSBC tackles the biggest issue in open source: Open Sourcing the > Enterprise > -Strategies to boost innovation and cut costs with open source > participation > -Receive a $600 discount off the registration fee with the source > code: SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |