Re: [Pyobjc-dev] Calling methods with variable arguments
Brought to you by:
ronaldoussoren
From: Ian B. <ia...@on...> - 2009-07-04 16:39:48
|
Thanks, Dirk. I believe that's exactly what I need if I'm going to figure out how to get this darn method working. Ian On Jul 4, 2009, at 6:07 AM, Dirk Stoop wrote: > Hi Ian, > > I'm not completely clear on the technical details of how > BridgeSupport definitions are used in PyObjC, but here's some > possible pointers: > > search for "withObjects" in the file linked below and you'll find > the exceptions defined for NSArray.arrayWithObjects: and other > similar methods: >> http://svn.red-bean.com/pyobjc/trunk/pyobjc/pyobjc-framework-Cocoa/Exceptions/Foundation.bridgesupport > > > This test file shows how to explicitely add metadata to a class > description at runtime: >> http://svn.red-bean.com/pyobjc/trunk/pyobjc/pyobjc-core/PyObjCTest/test_metadata_py.py > > > The example at line 45 seems to do something similar to what you need: > > objc.registerMetaDataForSelector("OC_MetaDataTest", > "makeObjectArray:on:", > dict( > arguments={ > 2+0: dict(type_modifier=objc._C_IN, > c_array_delimited_by_null=True, null_accepted=False), > } > ) > ) > > Good luck :) > - Dirk > > On Jul 3, 2009, at 4:40 AM, Ian Beck wrote: > >> Hey there, >> >> I'm currently loading up a custom Cocoa framework, and one of the >> methods I need to call involves variable arguments terminated by nil: >> >> [buildSomethingNamed:@"Name" withObjects:@"one", @"two", nil] >> >> I know that PyObjC typically has problems with varargs and needs a >> special wrapper. Is there anything I can do at my end (that is, >> outside the framework) to wrap this particular method and get it to >> work with PyObjC? >> >> Even a pointer to somewhere to find example code for dealing with >> varargs would be helpful; Google wasn't terribly useful. >> >> Ian >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Pyobjc-dev mailing list >> Pyo...@li... >> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > |